Skip to content

Instantly share code, notes, and snippets.

View jackkinsella's full-sized avatar

Jack Kinsella jackkinsella

View GitHub Profile

Rhythm Comms (v0.1)

  • The fundamental idea is to denote the "Grid Unit" (GU) distances between each onset. So 3-3-2 means you hit on the 1 (see assumptions), then 3 GUs later, then 3 GUs later, then 2 GUs later. The o's below indicate hits. The $ means the end of repeating unit. The pipe symbols correspond to groups of 4.

    | o - - o | - -  o - |$
  • The following assumptions are made:

  • Everything is in 4/4

@jackkinsella
jackkinsella / .vimrc
Created February 5, 2020 11:17
.vimrc
" Location for installing plugins
call plug#begin('~/.vim/plugged')
" Other plugins are specified with user/repo on Github or x.vim on vimscripts
" Git integration (status bar and commands like Gblame)
Plug 'tpope/vim-fugitive'
" Add info to sidebar about git
Plug 'airblade/vim-gitgutter'
" Add file-management commands like :Delete, :Move, and :Rename
Plug 'tpope/vim-eunuch'
@jackkinsella
jackkinsella / convert-word-files-to-markdown.sh
Last active March 10, 2021 15:31
Convert a folder of Word files to markdown using Pandoc
for filename in edited/*.docx; do
pandoc -s $filename -t markdown_mmd --extract-media "media-`$filename | cut -d- -f1-2`" --wrap=none --smart --normalize -o "`basename $filename .docx`".md
done

Keybase proof

I hereby claim:

  • I am jackkinsella on github.
  • I am jackkinsella (https://keybase.io/jackkinsella) on keybase.
  • I have a public key whose fingerprint is E905 B4A3 1968 F97A ADFC 5B15 E431 905C EF01 DF23

To claim this, I am signing this object:

@jackkinsella
jackkinsella / delayed_job_config.rb
Created May 16, 2014 14:13
Delayed Job Background Notification modification
# copy to: config/initializers/delayed_job_config.rb
# Fail at startup if method does not exist instead of later in a background job
[[ExceptionNotifier::Notifier, :background_exception_notification]].each do |object, method_name|
raise NoMethodError, "undefined method `#{method_name}' for #{object.inspect}" unless object.respond_to?(method_name, true)
end
# Chain delayed job's handle_failed_job method to do exception notification
Delayed::Worker.class_eval do
def handle_failed_job_with_notification(job, error)
@jackkinsella
jackkinsella / gist:43691a079f35b94ccdcc
Last active August 29, 2015 14:01
Google Analytics API usage
# Initialize the client & Google+ API
require 'google/api_client'
require "json"
client = Google::APIClient.new
analytics = client.discovered_api("analytics", "v3")
client = Google::APIClient.new
OUTPUT_FILE = "analytics.json"
FILE_WITH_KEY = "client.p12"
FILE_PASSWORD = "notasecret"
@jackkinsella
jackkinsella / blueprint_to_bootstrap.sh
Created July 25, 2012 14:39
Convert Blueprint to Twitter Bootstrap Span Classes - one-liner
# Commit before using this script since it changes your files permanently.
# Run from your web app's root folder.
ack -l "span-[0-9][0-9]?" | xargs sed -i "" -E 's/span-([0-9]{1,2})/span\1/'
@jackkinsella
jackkinsella / autoclose_janus
Created September 4, 2011 18:48
How to add autoclose to Janus
#~/.janus.rake file
vim_plugin_task "autoclose", "git://github.com/Townk/vim-autoclose.git"
#~/vimrc.local file
let g:AutoClosePairs = {'(': ')', '{': '}', '[': ']', '"': '"', "'": "'", '#{': '}', '|':'|' }
let g:AutoCloseProtectedRegions = ["Character"]
@jackkinsella
jackkinsella / Better Database Pulling With Heroku
Created April 15, 2011 11:11
Taps isn't reliable for anything but dummy databases. This command invokes the more powerful PGBackups. A side effect is that every time you pull your database locally a backup is also generated on your server.
#!/bin/bash
# Best use case is to create a file "update_local_db.sh" in your project folder and then call the command with bash update_local_db
# Follow me: @jackkinsella
function LastBackupName () {
heroku pgbackups | tail -n 1 | cut -d"|" -f 1
}
# This part assumes you have a low limit on no. of backups allowed
cd Code
#paths
export PATH=$PATH:/opt/local/bin
export MANPATH=$MANPATH:/opt/local/share/man
export INFOPATH=$INFOPATH:/opt/local/share/info
export PATH=/usr/local/mysql/bin:$PATH
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"
export PATH=$PATH:~/code/scripts