Skip to content

Instantly share code, notes, and snippets.

View scashin133's full-sized avatar

Sean Cashin scashin133

View GitHub Profile
@ericelliott
ericelliott / essential-javascript-links.md
Last active July 18, 2024 15:03
Essential JavaScript Links
@rjz
rjz / cs-jq-plugin-template.coffee
Created September 3, 2012 17:01
Coffeescript jQuery Plugin Class Template
# A class-based template for jQuery plugins in Coffeescript
#
# $('.target').myPlugin({ paramA: 'not-foo' });
# $('.target').myPlugin('myMethod', 'Hello, world');
#
# Check out Alan Hogan's original jQuery plugin template:
# https://github.com/alanhogan/Coffeescript-jQuery-Plugin-Template
#
(($, window) ->
# add helper methods
class String
def inspect_bytes
index = 0
self.each_byte do |b|
puts "#{index}: #{b} => #{b.chr}"
index += 1
end
end
def convert_to_utf8
@scashin133
scashin133 / bunlder_snippet.rb
Created February 1, 2011 21:46
snippet for requiring all gems in a Gemfile without having to load the rails environment or run with bundle exec
require 'rubygems'
require 'bundler'
ENV['BUNDLE_GEMFILE']="/path/to/Gemfile"
Bundler.require
@scashin133
scashin133 / rand_alphanum.sh
Created January 6, 2011 22:25
Used to generate a random alphanum string from command line without newlines.
# Linux
openssl rand -base64 1024 -out /dev/stdout | sed -r 's/[^a-zA-Z0-9]//g' | tr -d '\n'
# Mac OSX
openssl rand -base64 1024 -out /dev/stdout | sed 's/[^a-zA-Z0-9]//g' | tr -d '\n'