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
'use strict'; | |
var fs = require('fs'); | |
var path = require('path'); | |
var commentRx = /^\s*\/(?:\/|\*)[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+;)?base64,(.*)$/mg; | |
var mapFileCommentRx = | |
//Example (Extra space between slashes added to solve Safari bug. Exclude space in production): | |
/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/mg | |
function decodeBase64(base64) { |
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/sh | |
# Add git branch if relevant | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
# Extact tracker abbreviation and ticket number (e.g. DS-123) | |
parse_git_tracker_and_ticket() { | |
parse_git_branch | grep -e '[A-Z]\+-[0-9]\+' -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
#!/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: |
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
#!/usr/bin/env ruby | |
# A quick deployment script using rsync, just define FROM, SERVER, and TO | |
# HOW TO USE: | |
# 1. set FROM, SERVER, and TO | |
# 2. run : chmod 755 deploy.rb | |
# 3. you can add post deploy tasks at the bottom | |
# 4. ./deploy.rb | |
# the location of the project |
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
# abstract append text behavior into a function | |
append () { | |
if [[ -n "$1" ]]; then | |
echo $1 >> $2; | |
else | |
echo "USAGE : append 'your text' [file_to_append]"; | |
fi | |
} |
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://github.com/search?type=Everything&language=&q=%s&repo=&langOverride=&x=0&y=0&start_value=1 |
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
#!/usr/bin/env ruby -wKU | |
if ARGV[0].nil? | |
puts " gh_search [name_of_repo]: \n - Copies repo url to clipboard (via pbcopy) if only one repo is found" | |
else | |
search_string = "Searching github for #{ARGV[0]}...." | |
border = "="*search_string.length |
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 | |
if [[ -n "$1" ]]; then | |
cd /Applications/CrashPlan.app/Contents/Resources/Java/conf/ | |
echo "Linking remote settings, open Crashplan once you are logged in."; | |
ln -nfs ui.remote.properties ui.properties; | |
ssh $1; | |
echo "Linking local settings, Crashplan is back at local settings."; | |
ln -nfs ui.local.properties ui.properties; | |
cd ~; |
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
var is = function() { | |
return { | |
// is.not_defined(obj_or_var) | |
not_defined : function(obj) { | |
return typeof(obj) == 'undefined'; | |
}, | |
// is.defined(obj_or_var) | |
defined : function(obj) { | |
return typeof(obj) != "undefined"; | |
} |
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
# should be in Ruby Core | |
class String | |
# grab the first character | |
def first | |
self[0..0] | |
end | |
# grab the last character | |
def last | |
self[(self.length-1)..(self.length-1)] |
NewerOlder