This file contains hidden or 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
return (isNaN(ai) || isNaN(bi)) ? | |
(a > b) ? 1 | |
: (a < b) ? -1 | |
: 0 // not floats | |
: (ai > bi) ? 1 | |
: (ai < bi) ? -1 | |
: 0; |
This file contains hidden or 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
use 5.010; | |
use strict; | |
my $i = 0; | |
my %fb = qw (3 fizz 5 buzz 7 wolf); | |
my %h = map { (2 ** $i++), $_ } qw (fizz buzz wolf); | |
for my $x (1..105) { | |
my $num = 0; |
This file contains hidden or 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
fs.readdir(dir, function(err, files){ | |
for(x in files){ | |
let fn = files[x]; | |
if (! fn.match(/\.html$/)) { | |
continue; | |
} | |
fs.readFile( | |
dir + '/' + fn, |
This file contains hidden or 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
$ http localhost:5000/trope Accept:application/json | |
HTTP/1.0 200 OK | |
Content-Length: 130 | |
Content-Type: application/json | |
Date: Wed, 19 Feb 2014 14:11:31 GMT | |
Server: HTTP::Server::PSGI | |
Vary: Accept | |
{ | |
"items": [ |
This file contains hidden or 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
1p() { | |
echo -en "\033[?7l" | |
"$@" | head -$(expr $(tput lines) - 2) | |
echo -e "\033[?7h" | |
} |
This file contains hidden or 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
package Hackmachine::Resource; | |
use strict; | |
use warnings; | |
use parent 'Web::HyperMachine::Resource'; | |
__PACKAGE__->uri('hack'); | |
__PACKAGE__->related('Hackmachine::OtherResource'); |
This file contains hidden or 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
package Hackmachine::Resource; | |
use strict; | |
use warnings; | |
use Data::Dumper; | |
use parent 'Web::Machine::Resource'; | |
our @data = qw( hello hi hey howdy ); |
This file contains hidden or 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
package Hackmachine::Resource; | |
use strict; | |
use warnings; | |
use Data::Dumper; | |
use parent 'Web::Machine::Resource'; | |
our @data = qw( hello hi hey howdy ); |
This file contains hidden or 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
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAn0dZ1d26Ybg0Nj0/fae+bCEsOhkCyltgfpV2MKzoIZmNEbEiHftuTps0apKYvwnR3/uNtMZfi0wUuxhw27xOZBJdHt3UxfCFcpCiCT+7WXLxch39WGOxGXoFJdrZFFw+WrR/c5sZP+5XhD6QOFwbfmHJ27OMd2FBDdrt/tAEtKhLZgR7HZ4RsTz0RtxRSgUXDYkd9njE0nnIjhYtTMRcUNggJuV5oeUOgzYdNQfa0HvARR5xZW/WLhajP+QpcLHMy/go3Sp+7OT7FXbn2fUVRtY+zCF88GVSqlrnpcv5Hf7qRU7DAaEM4OoAR+EaQxrr1YuhKBZPERWzSxVSOtgCaw== alastair@PROP110 |
This file contains hidden or 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
function! GitDiff() | |
let l:myft = &filetype | |
diffthis | |
" deal with submodules by temporarily changing to the file's dir | |
cd %:p:h | |
vnew | 0r !git show HEAD:./#:t | |
norm 1G | |
exec 'set ft=' . l:myft | |
set nomod ro |