git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
config.action_controller.asset_host = Proc.new do |source, request| | |
non_ssl_host = "http://asset#{source.hash % 4}.backpackit.com" | |
ssl_host = "https://asset1.backpackit.com" | |
if request.ssl? | |
case | |
when source =~ /\.js$/ | |
ssl_host | |
when request.headers["USER_AGENT"] =~ /(Safari)/ | |
non_ssl_host |
Inline Validation for Symphony | |
------------------------------ | |
@version 1.0 | |
@release 10th September 2009 | |
@jquery 1.3.2 | |
Allows you attach inline Ajax validation to your forms. | |
The validation appears on inputs and textareas after the user | |
has filled them out (why validate on nothing..). The error |
<?php | |
/* | |
* Postcode validation function | |
* Based on code by John Gardner: http://www.braemoor.co.uk/software/postcodes.shtml | |
* Converted to use PCRE rather than the now deprecated POSIX regular expressions by | |
* David Evans. | |
* | |
* Optional second argument is set to the properly capitalised and spaced version of | |
* the postcode. |
#!/usr/bin/env ruby | |
dry_run = ARGV.delete('--dry-run') | |
force = ARGV.delete('--force') | |
if ARGV.empty? | |
puts <<-USAGE | |
minify, swiftly concat and minify JavaScript files from the command line | |
Pass a single argument to create a .min.js version: |
# Retrieve repository URL | |
function svn-url() { | |
LANG=en_US svn info "$1" | grep '^URL *:' | sed 's/^URL *: //' | |
} | |
# Branching | |
function svn-branch() { | |
if [ ! -d .svn ]; then return 1; fi | |
if svn-url | grep '/trunk' &> /dev/null; then | |
echo trunk |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
jQuery.fn.highlight = function (text, o) { | |
return this.each( function(){ | |
var replace = o || '<span class="highlight">$1</span>'; | |
$(this).html( $(this).html().replace( new RegExp('('+text+'(?![\\w\\s?&.\\/;#~%"=-]*>))', "ig"), replace) ); | |
}); | |
} | |
jQuery.fn.autolink = function (target) { | |
if (target == null) target = '_parent'; | |
return this.each( function(){ |
/* | |
* Copyright (c) 2012 Agency Republic | |
* | |
* Permission is hereby granted to use, modify, and distribute this file | |
* in accordance with the terms of the license agreement accompanying it. | |
*/ | |
package com.agencyrepublic.template | |
{ | |
/** | |
* Sample interface class. |