Skip to content

Instantly share code, notes, and snippets.

return (isNaN(ai) || isNaN(bi)) ?
(a > b) ? 1
: (a < b) ? -1
: 0 // not floats
: (ai > bi) ? 1
: (ai < bi) ? -1
: 0;
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;
fs.readdir(dir, function(err, files){
for(x in files){
let fn = files[x];
if (! fn.match(/\.html$/)) {
continue;
}
fs.readFile(
dir + '/' + fn,
$ 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": [
@Altreus
Altreus / gist:9074843
Created February 18, 2014 16:54
force one page of output
1p() {
echo -en "\033[?7l"
"$@" | head -$(expr $(tput lines) - 2)
echo -e "\033[?7h"
}
package Hackmachine::Resource;
use strict;
use warnings;
use parent 'Web::HyperMachine::Resource';
__PACKAGE__->uri('hack');
__PACKAGE__->related('Hackmachine::OtherResource');
package Hackmachine::Resource;
use strict;
use warnings;
use Data::Dumper;
use parent 'Web::Machine::Resource';
our @data = qw( hello hi hey howdy );
package Hackmachine::Resource;
use strict;
use warnings;
use Data::Dumper;
use parent 'Web::Machine::Resource';
our @data = qw( hello hi hey howdy );
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAn0dZ1d26Ybg0Nj0/fae+bCEsOhkCyltgfpV2MKzoIZmNEbEiHftuTps0apKYvwnR3/uNtMZfi0wUuxhw27xOZBJdHt3UxfCFcpCiCT+7WXLxch39WGOxGXoFJdrZFFw+WrR/c5sZP+5XhD6QOFwbfmHJ27OMd2FBDdrt/tAEtKhLZgR7HZ4RsTz0RtxRSgUXDYkd9njE0nnIjhYtTMRcUNggJuV5oeUOgzYdNQfa0HvARR5xZW/WLhajP+QpcLHMy/go3Sp+7OT7FXbn2fUVRtY+zCF88GVSqlrnpcv5Hf7qRU7DAaEM4OoAR+EaQxrr1YuhKBZPERWzSxVSOtgCaw== alastair@PROP110
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