This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'action_controller' | |
require 'jammit' | |
require 'jammit/controller' | |
Jammit::Controller.class_eval do | |
def before_parse_request | |
case params[:package] + '.' + params[:extension] | |
when 'namespace.module.js' | |
params[:package] = 'namespace.module' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'tilt-mustache' | |
# Mustache Renderer | |
module Middleman::Renderers::Mustache | |
class << self | |
def registered(app) | |
# Mustache is not included in the default gems, | |
# but we'll support it if available. | |
begin | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# visit your iOS backups folder | |
cd ~/Library/Application\ Support/MobileSync/Backup/ | |
# go to the most recent backup sub-folder | |
cd `ls -t1 | head -1` | |
# find the YouTube bookmarks file | |
grep -r "BookmarksMergeOffered" . | |
> ./fa2a1edd7d2789794b49856a1ad60f6ff002f1e0: <key>BookmarksMergeOffered</key> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cat = new Cat() | |
var statechart = Stativus.createStatechart() | |
statechart.addState("meowing", { | |
enterState: function(){ | |
cat.startMeowing() | |
}, | |
exitState: function(){ | |
cat.stopMeowing() | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Cat Stativus</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script src="https://raw.github.com/etgryphon/stativus/master/stativus.js"></script> | |
</head> | |
<body> | |
<div id="output"> | |
<div class="cat-meow" style="display:none; white-space: pre; font-family: monospace"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
</head> | |
<body> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> | |
<script src="https://raw.github.com/paulirish/matchMedia.js/master/matchMedia.js"></script> | |
<script src="https://raw.github.com/paulirish/matchMedia.js/master/matchMedia.addListener.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# space150 vine grabber | |
# given a vine.co uri, downloads the MP4 and creates an image sequence / GIF from it | |
# requires ruby, ffmpeg, and imagemagick | |
require 'open-uri' | |
require 'nokogiri' | |
id = ARGV[0] | |
# try to convert from URL to id. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# tiny hex to rgb | |
# via http://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb/11508164#11508164 | |
def rgb(color) | |
[16, 8, 0].map { |n| color >> n & 255 } | |
end | |
rgb 0xfa029a | |
=> [250, 2, 154] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SuperCollider's SequenceableCollection blend, blendAt in CoffeeScript | |
# SEE ALSO: | |
# https://github.com/supercollider/supercollider/blob/master/SCClassLibrary/Common/Core/Object.sc | |
# http://danielnouri.org/docs/SuperColliderHelp/Collections/SequenceableCollection.html | |
# http://coleingraham.com/2012/12/31/notes-between-chromatic-just-intonation/ | |
# http://mohayonao.github.com/subcollider.js/ | |
class ArrayUtil | |
# via https://github.com/supercollider/supercollider/blob/master/SCClassLibrary/Common/Core/Object.sc | |
@blendAt: (array, index) -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# token.rb | |
# A minimal re-usable module for "token" slugs on ActiveRecord models (AKA shortcodes, tiny urls) | |
# | |
# USAGE | |
# | |
# class Project < ActiveRecord::Base | |
# include Token | |
# end | |
# | |
# see also: |