View diamond.go
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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
) | |
func main() { |
View refcounts.pl
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
#!/usr/bin/env perl | |
use v5.16; | |
use warnings; | |
use Devel::Refcount qw(refcount); | |
my $href = {}; | |
say "BEGIN:" . refcount($href); |
View gist:1445090
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
$ perl -MJSON -E 'say encode_json [1, 2, 3,]' | |
[1,2,3] | |
$ python -c 'import json; print(json.dumps([1, 2, 3,]))' | |
[1, 2, 3] | |
$ ruby -r json -e 'puts [1, 2, 3,].to_json' | |
[1,2,3] | |
$ coffee -e 'console.log [1, 2, 3,]' |
View local notes
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
$ notes init | |
Initializing notes (/home/tim/.notes)... | |
Initialized empty Git repository in /home/tim/.notes/.git/ | |
$ notes add Hello World | |
Waiting for Emacs... | |
fatal: No configured push destination. | |
Either specify the URL from the command-line or configure a remote repository using | |
git remote add <name> <url> |
View tunesio.pl
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
#!/usr/bin/env perl | |
# Download all the files in a daily playlist from tunes.io | |
# | |
# https://gist.github.com/3734797 | |
$ENV{MOJO_MAX_MESSAGE_SIZE} = 30_000_000; | |
use v5.16; | |
use warnings; |
View jsonlint.py
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
#!/usr/bin/env python | |
import argparse | |
import json | |
import jsonschema | |
parser = argparse.ArgumentParser( | |
description='validate the json file against the json schema') | |
parser.add_argument( | |
'datafile', type=argparse.FileType('r'), |
View call_perl.el
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
;; Use some Perl to insert the date. | |
(defun myday () | |
"print the date" | |
(interactive) | |
(call-process "perl" nil t nil "-e" " | |
# perl code here | |
my @Monat = qw(Januar Februar Maerz April Mai Juni Juli August | |
September Oktober November Dezember); | |
my @Tag = qw(Sonntag Montag Dienstag Mittwoch Donnerstag Freitag |
View nhl-api.pl
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
#!/usr/bin/env perl | |
use v5.28; | |
use warnings; | |
use experimental qw(signatures); | |
use Data::Printer; | |
use Encode qw(encode); | |
use Getopt::Long::Descriptive; | |
use Interpolation E => 'eval'; | |
use Mojo::JSON qw(decode_json encode_json); |
View people.json
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
{"ANA":{"Adam Henrique":{"lastName":"Henrique","nationality":"CAN"},"Ben Hutton":{"lastName":"Hutton","nationality":"CAN"},"Cam Fowler":{"lastName":"Fowler","nationality":"USA"},"Carter Rowney":{"lastName":"Rowney","nationality":"CAN"},"Danton Heinen":{"lastName":"Heinen","nationality":"CAN"},"Derek Grant":{"lastName":"Grant","nationality":"CAN"},"Hampus Lindholm":{"lastName":"Lindholm","nationality":"SWE"},"Isac Lundestrom":{"lastName":"Lundestrom","nationality":"SWE"},"Jacob Larsson":{"lastName":"Larsson","nationality":"SWE"},"Jakob Silfverberg":{"lastName":"Silfverberg","nationality":"SWE"},"Jani Hakanpaa":{"lastName":"Hakanpaa","nationality":"FIN"},"John Gibson":{"lastName":"Gibson","nationality":"USA"},"Josh Mahura":{"lastName":"Mahura","nationality":"CAN"},"Josh Manson":{"lastName":"Manson","nationality":"CAN"},"Kevin Shattenkirk":{"lastName":"Shattenkirk","nationality":"USA"},"Max Comtois":{"lastName":"Comtois","nationality":"CAN"},"Max Jones":{"lastName":"Jones","nationality":"USA"},"Nicolas Deslaurie |
View to_mp3.pl
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
#!/usr/bin/env perl | |
use v5.28; | |
use warnings; | |
use Path::Tiny; | |
use String::ShellQuote; | |
my $dir = path(shift // '..'); | |
# Convert the .opus files by piping to opusdec first. |
OlderNewer