News for hackers. Stuff that matters.

rthprog

Re:Rate-limiting JavaScript function calls on Monday October 15, 2012 @02:20PM (#4656372)
OP here.

I updated the post with a link to underscore's annotated source for debounce and throttle. Thanks for the tip.

Re:Chrome Killed UserScripts.org on Thursday September 13, 2012 @01:34AM (#4514921)
I'm a bit disappointed that Google's alternative (the Chrome web store) requires a fee, even if it's only $5.

It seems kind of silly for Google to ask for a fee to distribute a free extension, especially since there is no way for a developer to distribute it themselves.

Re:Static Asset Compilation on Thursday September 13, 2012 @01:25AM (#4514904)
Aside from minifying javascript, you should probably also consider using Google's Closure Compiler in 'Advanced-Compilation' mode. I believe it does a much better job than traditional minification.

https://developers.google.com/closure/compiler/docs/api-tuto...

Re:JQuery now runs on every second website on Monday August 13, 2012 @03:04PM (#4377505)
As much as I love jQuery, I feel it can quickly become a crutch, particularly for those who have spent a fair bit of time relying on features like .animate(). Modern browsers often have alternatives that (depending on the situation) simplify your code and offer significantly better performance. Similarly, I cringe whenever I see jQuery UI pop up in an interface - while it's easy to use, it also keeps some from developing UI features of their own.

There's a time and place for everything, and as a whole, I feel many are over-relying on jQuery.

Re:Smart Notebooks: Building a Better Shared Document on Monday August 13, 2012 @01:05PM (#4376864)
"Also, Google Docs doesn't really do much for version control"

Why would anyone need something beyond Google's 'See revision history' tool? Sure, you're missing some features software engineers are used to, but I'm not understanding why people would need this.

Re:Smart Notebooks: Building a Better Shared Document on Monday August 13, 2012 @01:01PM (#4376836)
Google Drive keeps local copies of things that can be modified offline.
Re:Wristwatch in only HTML/CSS on Sunday August 12, 2012 @12:34PM (#4372871)
Very cool! Though the title isn't quite right - there definitely are images in the source, so it's not actually 'only HTML/CSS'
Re:Why I'm Doing It All Wrong on Wednesday June 20, 2012 @04:55PM (#4139043)
Good for you Dan.

I'm curious - is 'Airtime for Email' keeping it's name now that Sean Parker & Shawn Fanning started 'Airtime'?

Re:AngularJS 1.0 released on Thursday June 14, 2012 @05:31PM (#4113607)
I work at Google. Angular is certainly used internally - that said, no team is forced to use it, or switch to it.
Re:Fixie.js - Automatic filler content for HTML documents. on Thursday May 03, 2012 @02:25PM (#3925053)
You can now assign the class to a container div - you must still provide some empty tags to specify what kind of content you want.

For example, if you need a couple paragraphs of text, you can use `<article class="fixie"></article>`. If you need exactly 1 header followed by 3 paragraphs, you can use ``` <article class="fixie"> <h1></h1> <p></p> <p></p> <p></p> </article> ```

Re:Fixie.js - Automatic filler content for HTML documents. on Thursday May 03, 2012 @09:09AM (#3923661)
The point isn't to write content for you - it's to automatically add temporary content so you can test out your design before writing copy.
Re:Fixie.js - Automatic filler content for HTML documents. on Thursday May 03, 2012 @07:42AM (#3923332)
Thanks! It's actually kind of funny how small the dictionary is...
Re:Fixie.js - Automatic filler content for HTML documents. on Thursday May 03, 2012 @07:42AM (#3923331)
This has been replaced by `fixie.init(["CSS-selector"]);`
Re:Fixie.js - Automatic filler content for HTML documents. on Thursday May 03, 2012 @07:42AM (#3923327)
As mentioned elsewhere, this is now implemented as `fixie.init(["CSS-selectors"]);`
Re:Fixie.js - Automatic filler content for HTML documents. on Thursday May 03, 2012 @07:41AM (#3923322)
Nice suggestion. I made some modifications so this is the new behavior. Child elements are targeted, and content is never overwritten.

``` <div class="fixie"> <p></p> <p>Hello <a></a></p> </div> ``` The above will cause only the first `<p>` tag to be filled, and the `<a>` tag.

In addition, you can now use `fixie.init(["CSS-selector"]);` to target arbitrary tag names, class names, and ids. If the tag in question contains text content, it will not auto-fill it (though it will auto-fill children, if need be).

Re:Fixie.js - Automatic filler content for HTML documents. on Thursday May 03, 2012 @07:37AM (#3923304)
This is fully implemented now. Woohoo :)
Re:Fixie.js - Automatic filler content for HTML documents. on Thursday May 03, 2012 @12:25AM (#3922375)
Nice! I added it as an issue just a second after you.

I'll definitely give it a try, though I invite anyone else to send a pull request.

Re:Fixie.js - Automatic filler content for HTML documents. on Thursday May 03, 2012 @12:06AM (#3922332)
I considered doing that, but the problem is that I've noticed that some people use <p> tags as breaks between paragraphs. Requiring a class makes sure that the developer/designer knows where their filler content is going.
Re:Fixie.js - Automatic filler content for HTML documents. on Thursday May 03, 2012 @12:05AM (#3922330)
Agreed, lorem ipsum can become a crutch - good copy is integral for good design. That said, this script will give you random length paragraphs, articles, and what not, giving you some room to test your layout, and makes it easy to throw in temporary content until you've written something yourself.
Re:Fixie.js - Automatic filler content for HTML documents. on Wednesday May 02, 2012 @11:45PM (#3922296)
Now you can use a specific class instead. Just call fixie(myclassname);
Re:Fixie.js - Automatic filler content for HTML documents. on Wednesday May 02, 2012 @11:45PM (#3922294)
Good point.

While there are some situations where that makes more sense, doing that for things like paragraphs is kind of silly - you're just moving junk copy to your CSS. You either have a giant CSS file, or some rather repetitive paragraphs.

Re:Fixie.js - Automatic filler content for HTML documents. on Wednesday May 02, 2012 @11:41PM (#3922285)
On a side note, you can now change the class name to whatever you want (thanks Luke Holder via github).
Re:Fixie.js - Automatic filler content for HTML documents. on Wednesday May 02, 2012 @11:26PM (#3922246)
Sure, but it's hard to get a variety of content in that way. If you have a paragraph that begins with lorem ipsum over and over again, you'll quickly notice.

Older ยป