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 [ -z "${SAUCE_USERNAME}" ] || [ -z "${SAUCE_ACCESS_KEY}" ]; then | |
echo "This script can't run without your Sauce credentials" | |
echo "Please set SAUCE_USERNAME and SAUCE_ACCESS_KEY env variables" | |
echo "export SAUCE_USERNAME=ur-username" | |
echo "export SAUCE_ACCESS_KEY=ur-access-key" | |
exit 1 | |
fi | |
SAUCE_TMP_DIR="$(mktemp -d -t sc.XXXX)" |
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
module.exports = (generate) -> | |
{register, copy, mkdir, set, camelcase} = generate | |
# Register all generators in 1 file | |
# Templates are run through a <%= %> | |
# args are automatically 'set' and available inside templates | |
# extend string prototype w/ handy helpers | |
# need a --dry-run options | |
register(name: "bot", args: "<name>", run: (args) -> | |
mkdir("src/bots/<%= name.camelcase %>") |
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
/*! | |
* toggleAttr() jQuery plugin | |
* @link http://github.com/mathiasbynens/toggleAttr-jQuery-Plugin | |
* @description Used to toggle selected="selected", disabled="disabled", checked="checked" etc… | |
* @author Mathias Bynens <http://mathiasbynens.be/> | |
*/ | |
;(function($) { | |
$.fn.toggleAttr = function(attr) { | |
return this.each(function() { | |
$(this).attr(attr) ? $(this).removeAttr(attr) : $(this).attr(attr, attr); |
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 'ipaddr' | |
module Rack | |
# | |
# BanHammer is a Rack middleware app that restricts access to your server | |
# using a black-list of IPv4/IPv6 addresses and ranges. | |
# | |
# MIT License - Hal Brodigan (postmodern.mod3 at gmail.com) | |
# | |
# Needlessly modified by Mike Frawley |
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
# assumes you've got a copy of 'who let the dogs out' in your tmp dir | |
require 'rubygems' | |
require 'rest_client' | |
$url = "http://www.brownpapertickets.com/event/72123" | |
def site_up? | |
RestClient::get($url) rescue false | |
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
describe 'Creating a Sheet...' | |
setup_page(1, function () { | |
pane = new Ext.ux.NewSheet() | |
area = display(pane, '#new-sheet') | |
form = pane.items.get(0).getForm(); | |
^ | |
.., must specify a unique sheet id ... | |
.., in an input box |
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
# `irb` console session. | |
# Making a class, making it comparable, overriding its display formats, and using map! | |
# Make a class that mixins Comparable and defines <=> so it gets all <, ==, >, etc. | |
# Other methods like Array.sort will now work too | |
>> class Box | |
>> def <=>(other) | |
>> [source, color] <=> [other.source, other.color] | |
>> 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
# see http://troy.yort.com/short-fast-micro-whois | |
# original http://gist.github.com/82956 | |
# 0 if available | |
# 1 if taken | |
d () { | |
# Append ".com" to input if doesn't contain a ".": | |
domain=$1 | |
if [[ ! $1 =~ \.\w+$ ]]; then | |
domain=$domain.com | |
fi |