Skip to content

Instantly share code, notes, and snippets.

@scharfie
scharfie / gist:309412
Created February 20, 2010 01:08 — forked from dburger/gist:28214
# modifications from standard capistrano deploy as taken from:
# http://devthatweb.com/view/deploy-any-project-using-capistrano-2
set :application, "name removed"
set :repository, "url to trunk of repo"
# If you aren't deploying to /u/apps/#{application} on the target
# servers (which is the default), you can specify the actual location
# via the :deploy_to variable:
set :deploy_to, "/var/www/#{application}"
# Factory girl, relaxed.
#
# Factory.define :user do |f|
# f.login 'johndoe%d' # Sequence.
# f.email '%{login}@example.com' # Interpolate.
# f.password f.password_confirmation('foobar') # Chain.
# end
#
# Factory.define :post do |f|
# f.user { Factory :user } # Blocks, if you must.
@scharfie
scharfie / yaml.vim
Created May 16, 2011 11:11 — forked from iangreenleaf/yaml.vim
Dumb-smart indentation for Yaml
" Vim indent file
" Language: Yaml
" Author: Ian Young
if exists("b:did_indent")
finish
endif
"runtime! indent/ruby.vim
"unlet! b:did_indent
let b:did_indent = 1
@scharfie
scharfie / gemspec-usage.md
Created February 27, 2012 13:36
test/spec/mini

Just install this in your apps like so:

gem 'test-spec-mini', :git => 'git://gist.github.com/1806986.git', :require => 'mini'

@scharfie
scharfie / copy-s3-bucket.rb
Created March 8, 2012 14:15 — forked from zefer/copy-s3-bucket.rb
Copy contents of an S3 bucket to a another bucket using an EC2 instance and a simple Ruby script. Useful for transferring large amounts of data and will work across geographic regions.
require 'rubygems'
require 'right_aws'
require 'yaml'
filename = ENV['FILE'].to_s
source = ENV['FROM'].to_s
destination = ENV['TO'].to_s
dry_run = true
puts "Please provide filename of s3 configuration" and exit(1) if filename == ""
@scharfie
scharfie / wol.rb
Created July 18, 2012 16:03 — forked from zunda/wol.rb
A ruby script which sends out a magic packet to wake up your PC
#!/usr/bin/ruby
# wol.rb: sends out a magic packet to wake up your PC
#
# Copyright (c) 2004 zunda <zunda at freeshell.org>
# Modified by scharfie <scharfie at gmail dot com>
#
# This program is free software. You can re-distribute and/or
# modify this program under the same terms of ruby itself ---
# Ruby Distribution License or GNU General Public License.
#
#
# Recurring Job using Delayed::Job
#
# Setup Your job the "plain-old" DJ (perform) way, include this module
# and Your handler will re-schedule itself every time it succeeds.
#
# Sample :
#
# class MyJob
# include Delayed::ScheduledJob
@scharfie
scharfie / jira
Last active August 29, 2015 14:16 — forked from ssbarnea/jira
#!/bin/sh -e
# JIRA startup script
#chkconfig: 2345 80 05
#description: JIRA
# Define some variables
# Name of app ( JIRA, Confluence, etc )
APP=jira
# Name of the user to run as