Joined April 2013
·
User

Fardjad Davari

undefined
·
·
·

Posted to Install all the DMG's!!! over 1 year ago

That's cool, you may want to create a Gist as well.

There is also a project called homebrew-cask which is a CLI workflow for administration of Mac applications distributed as binaries. Installing Vagrant with Cask installed would be as simple as running:

brew cask install vagrant
Posted to Get Lazy in javascript coding over 1 year ago

Also, var obj = Object.create(null) is not the same as obj = {}. Object.create creates an object and set it's prototype to the given object. So Object.getPrototypeOf(Object.create(null)) will be null but Object.getPrototypeOf({}) will be {}. Why that's important? If you do something like o.toString() on an object created from null, you'll get a TypeError because it doesn't have a prototype chain, while doing the same on {} will return [object Object].

Posted to Get Lazy in javascript coding over 1 year ago

Btw, var num = '100'*1; and parseInt('100') are not exactly the same. For example "" * 1 will be 0 but parseInt("", 10) will be NaN. Also make sure to specify a radix when using parseInt().

The first element of the array takes part of a temporary variable. I mean you're implicitly making a temporary variable (despite the title.)

Posted to SQL to Change WordPress Domain URL over 1 year ago

There's Wordpress Search and Replace Tool that can be useful for migration too.

Posted to 7 Tips for new node.js users over 1 year ago

@brettof86 node-fibers module would be an alternative.

Posted to Don't bother with `parseInt` over 1 year ago

Never use parseInt without specifying a radix.

@tome
OP just posted a cross-browser solution that works,
What's the point of removing the extra wrapper? Making the markup cleaner and better looking, right? Your workarounds IMO make it look worse.
Anyways, I would agree with the concept of dropping the old browsers support at some point, but that's not always an option.

Good point.
They're also known as YODA conditions.

Posted to Creating a 100mb file with dd over 1 year ago

I think the following is faster for generating files with null bytes as content:

dd if=/dev/zero of=zero bs=1 count=0 seek=100m

@jan3000 yes, that's another way to do it but it prints the ls output on screen as well. You may also want to redirect tee output to /dev/null:
ls | sudo tee /root/ls.out > /dev/null

Achievements
1,385 Karma
90,153 Total ProTip Views