This file contains 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 | |
# Ruby script to automatically "git rm" deleted files | |
DELETED_REXP = /^#\s+deleted:\s+(.*)/ | |
MARKER_LINE = '# Changed but not updated:' | |
lines = `git status` | |
found_marker = false |
This file contains 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
" | |
" Find a file. (like cmd-t in textmate) | |
" | |
" Put this into ~/.vim/plugins/Find.vim | |
" | |
" Modified not to find svn files, and not to look in ./vendor | |
" | |
" Based on http://www.vim.org/tips/tip.php?tip_id=1432 by Samuel Hughes | |
" | |
" From his notes; |
This file contains 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 | |
# Script to take a local git project and set up a remote project on our | |
# git server | |
# NB: This assumes your current working dir is the top-level of the project | |
# you want to send to the remote server, and that the local project is | |
# already a git repo. | |
GIT_SERVER=yourgitserver | |
GIT_HOME=/home/remoteuser/git |
This file contains 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 | |
require 'rubygems' | |
require 'active_resource' | |
require 'pp' | |
class Slice < ActiveResource::Base | |
API_KEY = 'MY API KEY GOES HERE' | |
self.site = %[https://#{API_KEY}@api.slicehost.com] | |
self.timeout = 600 |
This file contains 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
<h1>This is a test</h1> |
This file contains 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
<nav> | |
<ul id='nav'> | |
<li class='i_users'><a href="/admin/users"><span>Users</span></a></li> | |
<li class='i_table'> | |
<a class="active"><span>Customers</span></a> | |
<ul> | |
<li><a href="/advertisers" class="active"><span>Advertisers</span></a></li> | |
<li><a href="/publishers"><span>Publishers</span></a></li> | |
</ul> | |
</li> |
This file contains 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 | |
/usr/bin/osascript <<EOF | |
tell application "Google Chrome" | |
set docUrl to URL of (active tab of window 1) | |
set URL of (active tab of window 1) to docUrl | |
end tell | |
EOF | |
# /usr/bin/osascript <<EOF |
This file contains 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
# using Elixir 1.2.2 | |
$ mix new my_app | |
$ cd my_app | |
$ vi lib/my_app.ex | |
defmodule MyApp do | |
@doc """ | |
iex(1)> MyApp.foo | |
123 |
This file contains 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
class ImagesController < ApplicationController | |
skip_before_filter :ensure_logged_in | |
def show | |
id = "%s.%s" % [params[:id], params[:format]] | |
image = AdImage.find(id).decorate | |
send_data image.contents, :type => image.mimetype, :disposition => "inline" | |
rescue | |
render :text => '' | |
end |
This file contains 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 | |
require 'json' | |
# Create a git branch, off master, for a specific Pivotal Tracker ticket. | |
# The name of the branch will be the normalised title of the pivotal ticket. | |
USAGE = "USAGE:\ngit ticket TICKET_ID\n" | |
ticketid = ARGV[0] |
OlderNewer