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 [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
appify v3.0.1 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |
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 | |
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -jar /Applications/TechnicLauncher.jar |
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
FoosController < ApplicationController | |
def create | |
if @foo.save | |
render :create_success # => app/views/foos/create_success.coffee | |
else | |
render :create_error # => app/views/foos/create_error.coffee | |
end | |
end | |
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
$ ls -lR minecraft-mods | |
total 0 | |
drwxr-xr-x 36 ross staff 1.2K Jul 30 2012 1.2.5/ | |
drwxr-xr-x 8 ross staff 272B Jan 27 00:26 1.4.7/ | |
minecraft-mods/1.2.5: | |
total 46136 | |
-rw-r--r-- 1 ross staff 824K May 3 2012 BetterThanWolves-3.6.0.zip | |
-rw-r--r--@ 1 ross staff 84K May 2 2012 CameraStudioV1.2.4b347.zip | |
-rw-r--r--@ 1 ross staff 261K May 2 2012 Daxnitro's Shader Core M [1.2.5].zip |
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 'fileutils' | |
require 'yaml' | |
module Tower | |
module FixtureHelpers | |
def self.fixture(fixture_name) | |
fixtures[fixture_name] || fixture_not_found!(fixture_name) | |
end | |
def self.fixture_not_found!(fixture_name) |
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
Rails.application.assets.register_engine '.haml', Tilt::HamlTemplate | |
config.assets.register_mime_type 'text/html', '.html' | |
config.assets.paths << Rails.root.join('app', 'views', 'errors') | |
config.assets.precompile += %w(404.html 500.html) | |
config.exceptions_app = ActionDispatch::PublicExceptions.new(Rails.root.join('public', 'assets')) |
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
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> | |
<script type="text/javascript" charset="utf-8"> | |
$(function() { | |
var path = window.location.pathname.toString(); | |
var patterns = { | |
"about": /about$/i, | |
"contact": /contact$/i | |
}; | |
for (colorBarClass in patterns) { |
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
> ruby slugs.rb | |
id: 1639513188 | |
enciphered output, string-escaped for your convenience: | |
"X\xD0\x97N" | |
slug: lt1krc | |
decrypted id: 1639513188 | |
the same? | |
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
# Simple bijective function | |
# Basically encodes any integer into a base(n) string, | |
# where n is ALPHABET.length. | |
# Based on pseudocode from http://stackoverflow.com/questions/742013/how-to-code-a-url-shortener/742047#742047 | |
ALPHABET = | |
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split(//) | |
# make your own alphabet using: | |
# (('a'..'z').to_a + ('A'..'Z').to_a + (0..9).to_a).shuffle.join |
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
def fix_capybara_mongoid_matcher_conflict | |
Capybara::RSpecMatchers.module_eval do | |
alias :have_input :have_field | |
end | |
end | |
RSpec.configure do |config| | |
fix_capybara_mongoid_matcher_conflict | |
config.include Mongoid::Matchers | |
end |