Skip to content

Instantly share code, notes, and snippets.

Chris Allick chrisallick

Block or report user

Report or block chrisallick

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
chrisallick /
Created Apr 2, 2019
auto-switch node version when you cd into project directory
# Run 'nvm use' automatically every time there's
# a .nvmrc file in the directory. Also, revert to default
# version when entering a directory without .nvmrc
enter_directory() {
if [[ $PWD == $PREV_PWD ]]; then
View emailer_sender.rb
require 'aws-sdk-lambda' #
require 'json'
require 'sendgrid-ruby'
include SendGrid #
Encoding.default_external = 'UTF-8'
class EmailSender
View email_sender.rb
require 'aws-sdk-lambda' #
require 'json'
require 'sendgrid-ruby'
include SendGrid #
Encoding.default_external = 'UTF-8'
class EmailSender
View app.rb
require 'base64'
require 'openssl'
require 'sinatra'
require 'sinatra/partial'
require 'sinatra/reloader' if development?
require 'resque'
require './email_sender'
chrisallick / currently_playing.rb
Last active Aug 1, 2018
Pipe what is playing on spotify into a file for BUTT (broadcast using this tool)
View currently_playing.rb
#!/usr/bin/env ruby
require 'rubygems'
# usage
# ./currently_playing.rb > currently_playing.txt
def osascript(script)
system 'osascript', *script.split(/\n/).map { |line| ['-e', line] }.flatten
chrisallick / instascrape.rb
Created Apr 11, 2018
scrape instagram html json
View instascrape.rb
require 'rubygems'
require 'open-uri'
require 'json'
require 'nokogiri'
doc = Nokogiri::HTML(open(""))
data = ""
doc.css('script').each do |script|
chrisallick / blockchain.rb
Created Jul 18, 2017
tiny blockchain in ruby
View blockchain.rb
#import hashlib as hasher
require "rubygems"
require "digest"
# class Block:
# def __init__(self, index, timestamp, data, previous_hash):
chrisallick / sketch.js
Created Dec 7, 2016
preload, play, and crossfade audio tracks in p5js
View sketch.js
var audio = [];
var numTracks = 4;
function preload() {
audio[0] = loadSound('/audio/001.mp3');
audio[1] = loadSound('/audio/002.mp3');
audio[2] = loadSound('/audio/003.mp3');
audio[3] = loadSound('/audio/004.mp3');
View test.rb
require 'rubygems'
require 'httparty'
require 'json'
url = ''
response = HTTParty.get(url, headers: {
"Accept" => "application/json, */*; q=0.01",
"X-NewRelic-ID" => "VQQBV1FXGwQIXFRaAw==",
"X-Requested-With" => "XMLHttpRequest"
View bibinfo.js
"headings": [{
"key": "race_placement",
"name": "Place",
"align": "right",
"hidden": false
}, {
"key": "bib_num",
"name": "Bib",
"align": "right",
You can’t perform that action at this time.