Skip to content

Instantly share code, notes, and snippets.

View tcmacdonald's full-sized avatar
🪕

Taylor MacDonald tcmacdonald

🪕
  • Ample
  • Cincinnati, OH
View GitHub Profile
@uhlenbrock
uhlenbrock / template.rb
Created December 18, 2008 19:50
My Rails Template
# TODO
# - authentication for admin
# - hoptoad/exception_notification
# - setup layouts
# - any gems?
# - any plugins?
# - blueprint?
# Delete unneeded files
run 'rm README'
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@netj
netj / memusg
Last active November 5, 2024 15:18
memusg -- Measure memory usage of processes
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <[email protected]>
# Created: 2010-08-16
############################################################################
# Copyright 2010 Jaeho Shin. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
@albertoleal
albertoleal / deploy.rb
Created November 8, 2010 00:37
Capistrano Recipe - Deploy a Rails App to Webbynode
set :application, "your_application_name"
set :ip_address , "000.000.000.000"
set :scm, :git
set :repository, "[email protected]:albertoleal/OlaMundo.git"
set :branch, "master"
set :deploy_via, :remote_cache # Deploy only the changes you have made since last deploy.
set :user , "albertoleal"
set :deploy_to, "/home/albertoleal/#{application}"
@ryanahamilton
ryanahamilton / application.js
Created January 12, 2011 22:49
cross-browser input placeholder attribute support with jQuery and Modernizr
$(function(){
if (!Modernizr.input.placeholder){
$('#search input[type="search"]')
.clearValue();
}
});
$.fn.clearValue = function() {
@erichurst
erichurst / database.yml.example mysql2
Created May 9, 2011 02:58
Rails 3 database.yml examples
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
@markbates
markbates / date_time.coffee
Created May 11, 2011 19:07
Example: Rails-style date/time helpers in CoffeeScript
Number::seconds = ->
@ * 1000
Number::minutes = ->
@seconds() * 60
Number::minute = Number::minutes
Number::hours = ->
@minutes() * 60
@balepc
balepc / ses_statistics.rb
Created June 6, 2011 14:59
Amazon SES statistics Scout plugin
# Amazon Simple Email Service Statistics (http://aws.amazon.com/ses/)
# Displays Amazon SES automatically collected statistics regarding your sending activity:
# * Successful delivery attempts
# * Rejected messages
# * Bounces
# * Complaints
class SesStatisticsPlugin < Scout::Plugin
needs 'aws/ses'
@panicsteve
panicsteve / gist:1641705
Created January 19, 2012 18:26
Form letter template for acquired startups
Dear soon-to-be-former user,
We've got some fantastic news! Well, it's great news for us anyway. You, on
the other hand, are fucked.
We've just been acquired by:
[ ] Facebook
[ ] Google
[ ] Twitter