Skip to content

Instantly share code, notes, and snippets.

@toekneestuck
toekneestuck / Rakefile
Created June 8, 2012 14:42 — forked from fstrube/Rakefile
Rake tasks for deploying a web app via rsync, and comparing local / remote file changes
CONFIG = {
## -- Rsync Deploy config -- ##
# Be sure you have setup public / private key authentication
:ssh_host => "user@hostname", # The hostname can be an alias in ~/.ssh/config
:ssh_port => nil, # Default - use ~/.ssh/config
:document_root => "/var/www", # Remote document root
:rsync_delete => true, # Whether or not to delete remote files
:deploy_default => "rsync", # Not used
:restart_apache => nil, # Remote command to restart apache
@fstrube
fstrube / Rakefile
Created June 5, 2012 14:17
Rake tasks for deploying a web app via rsync, and comparing local / remote file changes
# Include all rake files in the tasks directory
Dir.glob('tasks/*.rake').each { |r| import r }
# Read configuration from tasks/config.yaml
require 'yaml'
CONFIG = YAML.load_file('tasks/config.yaml')[ENV['env'] || 'development']
# Default utility functions available in all tasks
def ok_failed(condition)
if (condition)
@fstrube
fstrube / .bashrc
Created June 1, 2012 18:25
Place your git branch name and status in your Bash / Terminal prompt
# Adding git-specific info to prompt
update_git_cwd() {
if git status > /dev/null 2>&1 && local BRANCH=`git branch | grep '^*' | cut -c3-`; then
if ! git status 2>/dev/null | grep 'working directory clean' > /dev/null 2>&1 ; then
BRANCH="$BRANCH\033[31m*"
fi
PS1=`printf '[local:\W (\033[32m%s\033[0m)] \$ ' "$BRANCH"`
else
PS1='[local:\W ] \$ '
fi
if (typeof (AC) === "undefined") {
AC = {}
}
AC.ImageReplacer = Class.create({
_defaultOptions: {
listenToSwapView: true,
filenameRegex: /(.*)(\.[a-z]{3}($|#.*|\?.*))/i,
filenameInsert: "_☃x",
ignoreCheck: /(^http:\/\/movies\.apple\.com\/|\/105\/|\/global\/elements\/quicktime\/|_(([2-9]|[1-9][0-9]+)x|nohires)(\.[a-z]{3})($|#.*|\?.*))/i,
attribute: "data-hires",
@desandro
desandro / README.markdown
Created February 24, 2012 15:17
addTap.js

addTap

helper function for adding click-ish events for touch devices

Usage

addTap( elem, onTap, options );

// for example

var box = document.getElementById('box');

@Jxck
Jxck / ecma5_on_v8.js
Created July 9, 2011 12:02
The sample usage of ECMA 5 Features Implemented in V8
/**
* The sample usage of ECMA 5 Mozilla Features Implemented in V8
* https://github.com/joyent/node/wiki/ECMA-5-Mozilla-Features-Implemented-in-V8
* You can use thease new feature of ECMA5 on Node.js as you like.
* because there is no IE :)
* Order is deferent form original wiki.
* Sources are Checked on Node.js v0.5.0(unstable), v0.4.9(stable)
*
* you can execute this file.
* $ node ecma5_on_v8.js