Display the current mouse region inside a DOM element just like a compass. See in action!
This file contains hidden or 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
# http://joshuawherring.com/blog/?p=2361 | |
source "/path/to/.pythonbrew/etc/bashrc" | |
VENV=$2 | |
PY=$1 | |
pythonbrew use ${PY} | |
echo "Using ${PY}" | |
pythonbrew venv use ${VENV} | |
echo "Venv ${VENV}" | |
shift 2 | |
echo "Executing $@ in ${VENV}" |
This file contains hidden or 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
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |
This file contains hidden or 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
-- | |
CREATE DATABASE dbname DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; | |
-- Where % is the wildcard for any host | |
GRANT ALL PRIVILEGES ON dbname.* TO 'user'@'host' IDENTIFIED BY 'password' WITH GRANT OPTION; | |
-- Update users privileges access | |
FLUSH PRIVILEGES; |
This file contains hidden or 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 'rubygems' | |
require 'bundler' | |
Bundler.require | |
require './application' | |
namespace :assets do | |
desc 'compile assets' | |
task :compile => [:compile_js, :compile_css] do | |
end |
This file contains hidden or 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 'mogli' | |
module FacebookIntegrationHelpers | |
shared_context "with unconnected facebook user" do | |
let(:fb_user) { create_test_user(installed: false) } | |
after { fb_user.destroy } | |
end | |
def app_client | |
Mogli::AppClient.new(AppConfig.facebook.access_token, AppConfig.facebook.app_id) |
This file contains hidden or 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
#!/bin/bash | |
USER="username" | |
HOST=$1 | |
BRIDGE=FALSE | |
while getopts "u:h:b": OPT; do | |
# echo "$OPT=$OPTARG" | |
case ${OPT} in | |
u) USER=${OPTARG};; | |
b) BRIDGE=TRUE;; |
This file contains hidden or 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
set cursorline | |
set hlsearch | |
set number | |
set ruler | |
set shiftwidth=2 | |
set tabstop=2 | |
syntax on |
This file contains hidden or 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
$('[data-nested="add"]').live 'click', (e)-> | |
e.preventDefault() | |
association = $(this).data('association') | |
fields = $(this).data('fields') | |
target = $("[data-association='#{association}_fields']") | |
regexp = new RegExp('new_' + association, 'g'); | |
new_id = new Date().getTime(); | |
fields = fields.replace(regexp, "new_" + new_id); | |