Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View bolandrm's full-sized avatar

Ryan Boland bolandrm

View GitHub Profile
@bolandrm
bolandrm / soundcloud.js.coffee
Last active January 2, 2016 00:38
uploading files to soundcloud with ajax
UPLOAD_ENDPOINT = 'https://api.soundcloud.com/tracks'
access_token = $('[data-soundcloud-upload]').data('soundcloud-upload')
$('#soundcloud-upload').change () ->
data = new FormData()
field = $('#soundcloud-upload')[0]
$.each field.files, (i, file) ->
data.append 'track[asset_data]', file
data.append 'track[title]', file.name
@bolandrm
bolandrm / .zshrc
Last active January 4, 2016 04:09
add ./bin to path if present (for spring)
DEFAULT_PATH=$PATH
# ...
# add ./bin to path for Spring (rails)
add_bin_to_path_if_necessary() {
if [[ -d ./bin ]]; then
export PATH=./bin:$DEFAULT_PATH
else
export PATH=$DEFAULT_PATH
@bolandrm
bolandrm / .vimrc
Last active January 4, 2016 06:19
Convert "This is a Description" => this_is_description
" <Leader>u will convert "I am following User1, User2, and User3" => i_am_following_user1_user2_and_user3
nnoremap <Leader>u Vi" :<C-w>%s/\%V,*\s/_/g<CR> :normal ds" guaW<CR>
@bolandrm
bolandrm / gist:9620473
Created March 18, 2014 13:52
listen for filepicker change event
$ ->
$('.filepicker-input').change (e, data) ->
url = e.originalEvent.fpfile.url
$('.js-filepicker-preview').attr('src', url)
$(this).closest('form').submit()
Simple demonstrations of putting AVR microcontrollers to sleep in power-down mode,
which results in minimum current. Coded with Arduino IDE version 1.0.4 (and with
the Arduino-Tiny core for the ATtiny MCUs, http://code.google.com/p/arduino-tiny/)
For ATmega328P, ~0.1µA.
For ATtinyX5 revisions that implement software BOD disable, ~0.1µA,
for ATtinyX5 revisions that don't, ~20µA.
@bolandrm
bolandrm / fontcustom.yml
Created March 11, 2015 21:03
Font Custom config file
# =============================================================================
# Font Custom Configuration
# This file should live in the directory where you run `fontcustom compile`.
# For more info, visit <https://github.com/FontCustom/fontcustom>.
# =============================================================================
# -----------------------------------------------------------------------------
# Project Info
# -----------------------------------------------------------------------------
@bolandrm
bolandrm / feature_error_progress_formatter.rb
Created June 4, 2015 21:19
output errors from logs for feature specs
# spec/formatters/feature_error_progress_formatter.rb
require 'rspec/core/formatters/progress_formatter.rb'
class FeatureErrorProgressFormatter < RSpec::Core::Formatters::ProgressFormatter
LINES_OF_CONTEXT = 15
TEXT_TO_SEARCH = "Internal Server Error"
FILE_TO_SEARCH = "log/test.log"
private