Skip to content

Instantly share code, notes, and snippets.

@mitchellh
mitchellh / gist:1277049
Created October 11, 2011 01:30
Configure Vagrant VM to use Host DNS for VPN
Vagrant::Config.run do |config|
# ...
config.vm.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
@khakimov
khakimov / gist:3558086
Created August 31, 2012 19:49
Matrix Effect in you terminal
echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}'
@Avaq
Avaq / dates.js
Last active December 20, 2017 13:04
new Date('12 dec, 20111') //-> +020111-12-11T23:00:00.000Z
new Date(-1, 1) //-> -000001-01-31T23:00:00.000Z
new Date(-1, -1) //-> -000002-11-30T23:00:00.000Z
new Date(-10, 1) //-> -000010-01-31T23:00:00.000Z
new Date('12 dec, 000201') //-> 0201-12-11T23:00:00.000Z
new Date('12 dec, 201') //-> 0201-12-11T23:00:00.000Z
new Date('1212 dec') //-> 1212-11-30T23:00:00.000Z
new Date('1212 2 dec 2') //-> 1212-12-01T23:00:00.000Z
new Date('1212 2 dec 4') //-> 1212-12-01T23:00:00.000Z
new Date('1212 2 dec') //-> 1212-12-01T23:00:00.000Z