Sunny Ripert sunny

View clock.coffee
1 2 3 4 5 6 7 8 9 10
# Via http://html5demos.com/svg-clock
# Usage:
# new Clock()
class Clock
SECONDS_HAND_SIZE = 0.95
MINUTES_HAND_SIZE = 0.85
HOURS_HAND_SIZE = 0.55
CIRCLE_SELECTOR = "#circle"
SECONDHAND_SELECTOR = "#secondhand"
MINUTEHAND_SELECTOR = "#minutehand"
View makexyz.rb
1 2 3 4 5 6 7 8 9 10
# Access makexyz.com's API to POST a design.
# http://www.makexyz.com/developers
#
# # Usage with Rails
#
# Add `gem "rest-client"` in your `Gemfile`.
#
# Place this file in your Rails' `lib` directory.
#
# Create a `config/initializers/makexyz.rb`:
View jquery.svgaddclass.coffee
1 2 3 4 5 6 7 8 9 10
# SVG AddClass
 
# newAddClass = (origAddClass) ->
# (classNames) ->
# classNames ||= ''
# this.each ->
# if $.svg.isSVGElem(this)
# $.fn.svgAddClass(classNames)
# else
# origAddClass.apply $(this), [classNames]
View tidy.conf
1 2 3 4 5 6 7 8 9 10
# Add this file in:
#
# ~/.config/tidy.conf
#
# Add to your environment (`.bashrc`):
#
# HTML_TIDY=~/.config/tidy.conf
#
# Use tidy:
#
View git-br
1 2 3 4 5 6 7 8 9 10
#!/bin/sh
# Via http://stackoverflow.com/a/18213567/311657
current_branch="$(git symbolic-ref --short -q HEAD)"
git for-each-ref --sort=committerdate refs/heads \
--format='%(refname:short)|%(objectname:short)|%(committerdate:relative)|%(authorname)|%(subject)|%(upstream:short)' \
| while IFS='|' read refname objectname date authorname subject upstream
do
reverse='\x1b[7m'
reset='\e[0m'
green='\e[32m'
View npm-install.sh
1 2 3 4 5 6 7 8 9 10
# Install me with:
# bash < <(curl https://gist.github.com/sunny/5607568/raw/npm-install.sh)
 
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
mkdir -p ~/local
mkdir -p ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local && make install
View Pathway.py
1 2 3 4
# Place in Sublime Text 2/Packages/User/
import os
os.environ['PATH'] += ':/usr/local/bin:/usr/local/sbin'
os.environ['PATH'] += ':' + os.environ['HOME'] + '/.rbenv/shims'
View git-checkout.rake
1 2 3 4 5 6 7 8 9 10
# encoding: UTF-8
#
# $ rake checkout new_branch_name
#
# Via https://gist.github.com/jonlemmon/4076864
#
# 1. Roll back any migrations on your current branch which do not exist on the
# other branch
# 2. Discard any changes to the db/schema.rb file
# 3. Check out the other branch
View outerhtml.js.coffee
1 2 3 4 5 6
# OuterHTML jQuery plugin with polyfill for Firefox < 11
# Example:
# $('ul').outerHTML() # => '<ul><li>Hi</li></ul>'
# $('ul').html() # => '<li>Hi</li>'
$.fn.outerHTML = ->
@[0].outerHTML || @clone().wrap('<b>').parent().html()
View paperclip_has_destroyable_file.rb
1 2 3 4 5 6 7 8 9 10
# encoding: UTF-8
class ActiveRecord::Base
 
# Class method to add destroyable paperclip attachments.
#
# Example:
# has_attached_file :image
# has_destroyable_file :image
# attr_accessible :image_delete
#
Something went wrong with that request. Please try again.