Sleep sort in Erlang by StepanKuzmin
Sleepsort in #erlang. More under the cut
Sleepsort in #erlang. More under the cut
zsh -x -c -i exit
nvm - node.js version manager
curl https://raw.github.com/creationix/nvm/master/install.sh | sh
Add the following line into ~/.zshrc or ~/.bashrc or whatever dotfiles your shell uses
[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh # This loads NVM
Install latest Node.js
nvm install latest
Coding 100% of my time on a laptop I noticed that I sit wrong and my spine is always bent. So I bought this amazing thing to fix this:

By now the experiment is OK – I feel really good, sit right with monitor in front of my eyes. What do you do to be a healthy coder?
Since I started using Gistflow — which I think is a superb application, by the way — I have accumulated a few #questions regarding some of the #features, #uses, workings, #quirks and various other things. I'll post my personal #FAQ questions here as I think of them.
Note: this post is likely to be edited/updated regularly. It's just that sort of post, don't feel bad. More under the cut

Hi guys! On 20 of April we had an amazing meetup in Moscow. Checkout presentations, notes on meetup and photo album: More under the cut
As we know we don't see scrolls on #OSX Lion and above by default, but sometimes we have to show them to user because of #UX.
We can do it just by adding scroll's styles. For example:
#myelement::-webkit-scrollbar {
-webkit-appearance: none;
width: 8px;
}
#myelement::-webkit-scrollbar-track {
background-color: #eee;
border-radius: 8px;
}
#myelement::-webkit-scrollbar-thumb {
border-radius: 8px;
background-color: #666;
}
for(var i=0; i<googletag.debug_log.H.length; i++) {
console.debug(googletag.debug_log.H[i]);
}
//...
NSData *somedata = ...
for (int i = 0; i < [somedata length]; i++) {
const uint8_t * databytes = [somedata bytes];
[self getBitStringForInt:(uint8_t)databytes[i]];
}
//...
- (void)getBitStringForInt:(int)value {
NSString *bits = @"";
for(int i = 0; i < 8; i ++) {
bits = [NSString stringWithFormat:@"%i%@", value & (1 << i) ? 1 : 0, bits];
}
NSLog(@"%@", bits);
}
PostgreSQL not having an UPSERT command, but it can do with WITH statement more under cut
When contributing to open source you may face a problem – your fork is outdated. There could be another scenario – git repo in Github is just mirror of perforce repo, so after your pull request is merged there won't be your commits in repo and you again will have to sync fork and origin.
git remote add upstream git://github.com/username/repo.git
git fetch upstream
git checkout master
git reset --hard upstream/master
git push origin master --force
In Gemfile:
gem 'capybara'
gem 'poltergeist'
The Problem:
$ rake spec
...
Failures:
1) An Example
Failure/Error: fill_in 'admin_email', with: admin.email
NotImplementedError:
NotImplementedError
...
openssl x509 -inform der -in xxx.cer -out xxx.pem
#ssl #pem #x509 via: http://queforum.com/unix/335-command-convert-der-pem.html
Hola amigos!
At first I would like to congratulate you with the Web Developer Day (it is 4.04 today) and announce new #meetup in Moscow
Given an image accessor field cover_image for an Image model, u can use a cover_image_url accessor for assigning directly from a url (simply using a string). To make it does what u want just save the corresponding object.
example:
img = Image.new
img.cover_image_url = 'http://img.youtube.com/vi/wh-XcmRQFhI/0.jpg'
img.save
BTW: what is your favourite image uploader in rails?
new FileOutputStream("shops.dtd").getChannel().transferFrom( new FileInputStream(new File(getClass.getResource("shops.dtd").toURI)).getChannel(), 0, Long.MaxValue )
I have a lot of code in my project like the following:
class Animal < ActiveRecord::Base
state_machine do
around_transition :on => :sure do |animal, _, block|
animal.transaction do
block.call
animal.do_things_on_sure
end
end
end
end
around_transition looks ugly and repeats for many classes.. Lets refactor it. More under the cut
pythonbrew is an RVM-like tool for Pythonistas. Developer can use different version of python under clean virtual environments and switch easily among them.
pip provides modern ways to install python packages directly from pypi. More under the cut

Really cool jelly game #js implementation:
6 levels: http://martine.github.com/jelly/
20 levels: http://avorobey.github.com/jelly/