Skip to content

Instantly share code, notes, and snippets.

View nickserv's full-sized avatar

Nicky McCurdy nickserv

View GitHub Profile
@nickserv
nickserv / 4chan_header_image_downloader.sh
Created June 26, 2014 03:18
Downloads all (known) header images used on 4chan.org
#!/bin/bash
directory="4chan header images" # the directory to download the images to
mkdir "$directory"
pushd "$directory" > /dev/null
curl -Of http://s.4cdn.org/image/title/[0-262].png
popd > /dev/null
@nickserv
nickserv / gist:b3d53f15e9e4f6ac84ee
Last active August 29, 2015 14:03
Miscellaneous Node utility functions
var fs = require('fs');
// Returns an Array of all directories in the current directory.
function getDirectories() {
return fs.readdirSync('.').filter(function (file) {
return fs.statSync(file).isDirectory();
});
}
// Returns a copy of the given Array with all elements of the blacklist Array
@nickserv
nickserv / deploy.rake
Created August 19, 2014 17:17
Rake task for deploying a Rails app to Heroku
# Deploy to Heroku in production
task deploy: ['deploy:push', 'deploy:migrate']
namespace :deploy do
APP = 'openatrit'
task :push do
puts 'Deploying site to Heroku ...'
puts `git push -f [email protected]:#{APP}.git master`
end
@nickserv
nickserv / cat.pl
Created October 5, 2014 05:03
Experiments with Perl
print <STDIN>;
@nickserv
nickserv / angular_codenames.rb
Created December 31, 2014 23:07
Script to list the codename for every AngularJS release
require 'open-uri'
changelog = open 'https://raw.githubusercontent.com/angular/angular.js/master/CHANGELOG.md'
headlines = changelog.grep(/^# /)
headlines.each do |headline|
version, codename = headline.match(/(\S+) +(\S+) +\([\d-]+\)/).captures
puts "#{version}: #{codename}"
end
@nickserv
nickserv / race.rb
Created January 30, 2015 00:46
Functional car racing game
# See https://github.com/paircolumbus/Functional-101/blob/nicks-solution/ex4-remove-state.rb
# Constants
DEFAULT_ROUNDS = [Array.new(3, 1)]
DEFAULT_TIME = 4
NEWLINE = "\n"
# Game functions
def should_move_position?
@nickserv
nickserv / config.yml.erb
Created April 21, 2015 14:43
Using ERB with a YAML config file in Ruby
:uri: http://example.com/?host=<%= hostname %>
@nickserv
nickserv / .gitignore
Last active March 18, 2017 22:16
karma-edge-launcher Example
node_modules
#!/usr/bin/env bash
for transform in node_modules/5to6-codemod/transforms/*.js; do
jscodeshift -t "$transform" $@
done
@nickserv
nickserv / durations.txt
Last active December 20, 2016 20:43
Simple Python 3 script to sum a list of durations. Data from https://soundcloud.com/wmstrecs/sets/n-o-i-s-e.
4:24
1:58
4:47
3:44
3:55
1:53
6:49
4:04
12:01
3:24