This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Plausible code | |
[] == 0 // true | |
+[] === 0 // true, wait whu? | |
++[] === 1 // sorta, though this is invalid js syntax, so... | |
// Somewhat unlikely and, lets be honest, regrettable code: | |
[[]][0] === [] | |
++[[]][0] === 1 | |
++[[]][+[]] === 1 // yay! wtf! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Boolean logic paradox via @amattie! | |
"0" && {} // true | |
0 && {} // false, ok...fair enough | |
0 == "0" // true, wtf! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
basename(dirname($path)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-| | |
Higher-level parser for building ASTs. | |
> I sang of leaves, of leaves of gold, and leaves of gold there grew: | |
> Of wind I sang, a wind there came and in the branches blew. | |
> Beyond the Sun, beyond the Moon, the foam was on the Sea, | |
> And by the strand of Ilmarin there grew a golden Tree... | |
-} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
octalStr='377'; | |
num = parseInt(octalStr,8); // num now holds 255 hexStr='7F'; | |
num = parseInt(hexStr,16); // num now holds 127 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rsync -avPz /backup/var/lib/mysql/my_database/* /var/lib/mysql/my_database/. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scenario: Install cucumber | |
Given I am running Ubuntu | |
And I have not yet installed cucumber | |
When I run "apt-get install ruby ruby1.8-dev rdoc1.8 irb libxml2-dev libxslt1-dev libc6-dev-i386 libopenssl-ruby" | |
# We install rubygems by hand because the apt version uses strange paths | |
And I run "wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz" | |
And I run "tar xvf rubygems-1.3.5.tgz" | |
And I run "cd rubygems-1.3.5" | |
And I run "sudo ruby setup.rb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XMonad | |
main = xmonad defaultConfig | |
{ modMask = mod4Mask -- Use Super instead of Alt | |
, terminal = "urxvt" | |
-- more changes | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[program:beerscore] | |
command=/usr/local/bin/php beerscore_bot.php | |
numprocs=1 | |
directory=/home/sean/findpint/twitterbot | |
stdout_logfile=/home/sean/findpint/twitterbot/supervisord.log | |
environment=BEERSCORE_USER=beerscore,BEERSCORE_PASS=[redacted] | |
autostart=true | |
autorestart=true | |
user=beerscore |
OlderNewer