Skip to content

Instantly share code, notes, and snippets.

Avatar

Sarah Vessels cheshire137

View GitHub Profile
@cheshire137
cheshire137 / 🎵 My Spotify Top Tracks
Last active January 10, 2022 00:01
🎵 My Spotify Top Tracks
View 🎵 My Spotify Top Tracks
RAINY NIGHT IN TALLINN Ludwig Goransson
Secret Clark
Lambent Rag Clark
THE PLAN Travis Scott
Citrus Clark
FREEPORT Ludwig Goransson
RED ROOM BLUE ROOM Ludwig Goransson
WINDMILLS Ludwig Goransson
Small Clark & Nathaniel
Olson Boards of Canada
@cheshire137
cheshire137 / spotify-to-itunes-playlists.rb
Last active June 29, 2020 08:21
Ruby script to create iTunes playlists from your Spotify playlists. Requires a Spotify API app.
View spotify-to-itunes-playlists.rb
#!/usr/bin/env ruby
require 'uri'
require 'json'
require 'net/https'
require 'time'
require 'cgi'
require 'csv'
# You need a Spotify API app to have a client ID and client secret. Create
# one at https://developer.spotify.com/my-applications/#!/applications/create
@cheshire137
cheshire137 / city_aliaser.rb
Last active March 13, 2019 17:27
List of aliases for US cities by state
View city_aliaser.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'mechanize'
require 'json'
url = "https://en.wikipedia.org/wiki/List_of_city_nicknames_in_the_United_States"
STATES = ["Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado",
"Connecticut", "Delaware", "Florida", "Georgia", "Hawaii", "Idaho",
"Illinois", "Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana",
"Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota",
@cheshire137
cheshire137 / keybase.md
Last active November 8, 2017 16:38
Proof for my keybase.io identity.
View keybase.md

Keybase proof

I hereby claim:

  • I am cheshire137 on github.
  • I am cheshire137 (https://keybase.io/cheshire137) on keybase.
  • I have a public key ASCYDtNML3BizFS2gSmgo_2osYnXm9sWQTp748en-luS6go

To claim this, I am signing this object:

View missing_spec_generator.rb
require 'erb'
# lib/missing_spec_generator.rb
class MissingSpecGenerator
RAILS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
def spec_file spec_path, file_name, spec_template, namespace
spec_name = file_name.gsub('.rb', '') + '_spec.rb'
if File.exist?("#{spec_path}/#{spec_name}")
puts "#{spec_path}/#{spec_name} exists"
@cheshire137
cheshire137 / git-line-history.sh
Last active June 24, 2016 16:30
Find all the Git commits that modified a particular line in a file.
View git-line-history.sh
#!/bin/bash
# Sample use:
# PATTERN="\"/some-route\"" FILE=config/routes.rb ~/bin/git-line-history.sh
# Thanks to mikedillion <https://github.com/mikedillion> for the basis of this!
set -e
#PATTERN="version':"
#FILE="setup.py"
@cheshire137
cheshire137 / git-cherry-pick-shas.js
Created September 24, 2015 22:01
Get cherry-pick commands for shas linked on a Github page
View git-cherry-pick-shas.js
// 1. Go to a URL like https://github.com/my-org/my-repo/pull/1/commits
// 2. Open up your browser JavaScript console.
// 3. Paste the command below.
// Now you have git cherry-pick commands for making a branch of those commits!
var commands = '';jQuery('a.sha').each(function() { var url = $(this).attr('href'); var sha = url.split('/commit/')[1]; commands += 'git cherry-pick ' + sha + "\n"; }); console.log(jQuery.trim(commands));
@cheshire137
cheshire137 / ronaldchase.rb
Created September 10, 2015 14:51
What does 'rc' stand for in all those .*rc files anyway? Why not Ronald Chase?
View ronaldchase.rb
#!/usr/bin/env ruby
require 'fileutils'
path = File.expand_path('~/.*rc')
Dir[path].each do |file|
next unless File.file?(file)
destination = file.gsub(/rc$/, 'ronaldchase')
puts "#{file} -> #{destination}"
FileUtils.ln_s(file, destination)