Joined July 2012
·

Avner Cohen

Developer and an Avid Birdwatcher at fiverr.com
·
Israel
·
·
·

Better not..
if no new commit happens, but someone fetched master, your commit will soon be added back...
--force, unless used on an isolated branch with a single comitter, should be avoided.

Posted to Node JS Seamless Deploy over 1 year ago

It really depends on your use case on source control being used.
We us git, and so we so we base the logic on git pull.
In the project I posted, you can also see a sample deploy.sh script that we use to apply the changes, using git:
https://github.com/AvnerCohen/node_template/blob/master/deploy.sh

Another view on deploy process is described in this issue (that was fixed since):
https://github.com/andrewrk/naught/issues/25

Posted to High-Value Shell Aliasing over 1 year ago

This is all nice, but:
alias c='cd'
Whatever you gain in the extra "d", you lose whenever you ssh to another machine.

Aliases are good and all, but typing 2-4 more chars is rarely the bottleneck for efficient development process,

Posted to Make bundler crazy fast over 1 year ago

As of Nov/3/2013, update to 1.4 (to use the parallelize feature) using:

gem install bundler --pre

Redis and Memcached are not comparable. many application, specially such applications that requires extremely high scale, will actually use both Redis and Memcached.

Redis is single threaded and allows for atomic operations by design, it's a Key/Value store with a very complex set of datatypes being supported and above all that, data in Redis can be persisted and hence still present across restarts.

Memcached is much simpler (and powerful exactly for that) and is the perfect solution for simple Key to Text Blocks, it's ability to compress content allows for efficient storage of large quantities of large text blocks (such as full HTML pages), data is stored in RAM only and hence, perishable.

So, as always, plain benchmarking is in many ways a little miss leading.

Posted to Git - Autocorrect spelling over 1 year ago

Never had a problem with that. git docs are saying: "If more than one command can be deduced from the entered text, nothing will be executed.".
I don't know for sure but I believe a basic algorithm such as levenshtein distance is used. also, there is pretty much nothing that can not be undone in Git using the reflog, so I see no risk here whatsoever.

Posted to Ignore changes in tracked files over 1 year ago

Nice and good to know. However, why not .gitignore it and commit -f?
You end up with same behavior (local changes ignored).

For Non rails app deploy, you could use Mina, might be a better fit. (it's probably also better for Rails deployment just as well..)

ctrl+shift+w or cmd+shift+w will close sublime on both osx and windows, on keyboard default binding, need to use ctrl+w instead.

Posted to Wishing you a multilingual Christmas over 1 year ago

Perl

$Xmas= "beer ";
$NewYear = "more beer";
if ($Xmas.$NewYear eq "beer more beer") {
  print "festive hangover";}

Lua

christmas="beer "
newYear="more beer"
if christmas..newYear=="beer more beer" then
    print ("festive hangover")
end
Posted to Tomorrow Text Editor Theme over 1 year ago

I like it. Just switched to "tomorrow" for a try :)

Posted to Publish Beta Versions of NPM Modules over 1 year ago

Nice one. Added to the cheat sheet: https://coderwall.com/p/f2btqa

Posted to Git AutoCorrect over 1 year ago

Yet another vote for coderwall feature "protip already exists" :
https://coderwall.com/p/gvw46q

Posted to JavaScript fast-floor over 1 year ago

Interesting. It does seem faster, to a degree:
http://jsperf.com/math-floor-no-loop & http://jsperf.com/math-floor

Posted to 0.1 + 0.2 !== 0.3 WTF? over 1 year ago
Posted to Git autocorrect over 1 year ago

It is a good indication that @coderwall is missing a good "tip already exists" feature:
http://coderwall.com/p/gvw46q?i=1&p=1&q=author%3Aavnerner&t%5B%5D=avnerner

Posted to Hello World in Java over 1 year ago

This should help you get going, Python - Check, Java - Check, 191 more to go:
http://en.wikipedia.org/wiki/Hello_world_program_examples

Give special care to this one:
http://en.wikipedia.org/wiki/Hello_world_program_examples#brainfuck

Achievements
1,383 Karma
68,775 Total ProTip Views