Skip to content

Instantly share code, notes, and snippets.

View elmer's full-sized avatar
:octocat:
exploring

Elmer Rivera elmer

:octocat:
exploring
View GitHub Profile
#
# = Capistrano database.yml task
#
# Provides a couple of tasks for creating the database.yml
# configuration file dynamically when deploy:setup is run.
#
# Category:: Capistrano
# Package:: Database
# Author:: Simone Carletti <weppos@weppos.net>
# Copyright:: 2007-2009 The Authors
@elmer
elmer / gist:241140
Created November 23, 2009 15:56 — forked from anonymous/gist:161265
system admin 101
== Rules ==
On Infrastructure
-----------------
There is one system, not a collection of systems.
The desired state of the system should be a known quantity.
The "known quantity" must be machine parseable.
The actual state of the system must self-correct to the desired state.
The only authoritative source for the actual state of the system is the system.
The entire system must be deployable using source media and text files.
# you'd obviously have more settings somewhere
set :scm, :git
set :repository, "git@github.com:defunkt/github.git"
set :branch, "origin/master"
set :migrate_target, :current
set(:latest_release) { fetch(:current_path) }
set(:release_path) { fetch(:current_path) }
set(:current_release) { fetch(:current_path) }
@elmer
elmer / bundler-header.rb
Created March 18, 2010 22:56 — forked from leehambley/bundler-header.rb
bundle setup
begin
require File.expand_path('../.bundle/environment', __FILE__)
rescue LoadError
# Fallback on doing the resolve at runtime.
require "rubygems"
require "bundler"
Bundler.setup
end
@elmer
elmer / Tests Is Wrong
Created April 10, 2010 13:00 — forked from rtomayko/Tests Is Wrong
Why "require 'rubygems'"...
In response to all the responses to:
http://twitter.com/rtomayko/status/1155906157
You should never do this in a source file included with your library,
app, or tests:
require 'rubygems'
The system I use to manage my $LOAD_PATH is not your library/app/tests
$projectroot = '/path/to/gitosis/repositories';
$gitosis_conf = '/path/to/gitosis/repositories/gitosis-admin.git/gitosis.conf';
$username = $cgi->remote_user;
$export_auth_hook = sub {
my $projectdir = shift;
if($projectdir =~ (/(.*?)\.git/)) {
my $projectname = basename($1);
open FILE, $gitosis_conf or die 'Could not open gitosis config file. Please make sure that $gitosis_conf is set properly';
my $project_match = 0;
my $user_match = 0;
// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
$(function() {
MIN_ANSWERS = 2
MAX_ANSWERS = 10
MIN_ANSWERS_MSG = "Minimum of two(2) answers required."
MAX_ANSWERS_MSG = "Maximum of ten(10) answers only."
TOP_ANSWER_MSG = "Can't go up answer is on the top list."
Last login: Wed Jul 28 16:22:55 2010 from 192.168.100.185
####[ Rocket Fuel, Inc. ]##################################################
Welcome to pww-16.rfiserve.net.
Host: pww-16.rfiserve.net
Site: pww
Vendor alias: srv16.rf.mlp1.peakwebhosting.com
Environment: production
#!/usr/bin/env bash
function manage_user()
{
user=$1
password=$2
shift; shift;
out=`ralsh user $user password='$password' ensure=present`
echo $out | grep 'notice.*changed password'
# Hey coops..
#
# Imagine yourself on the other side of the table: two job openings, hundreds of resumes,
# _all of which_ look friggin' identical. Yeah, the HR departments at your MegaCorp XYZ are using
# automated tools to scan for keywords, and the coop department at your school is trying to beat
# you into submission to follow some "predefined template".. But, unless what you're aspiring to
# is to be an automaton at MegaCorp XYZ, relegated to writing test harnesses for code that will
# never see the light of day.. please do yourself a favor, and _be different_! Be bold, dammit.
#
# (Frankly, I'm falling asleep while reading your resumes.. Wake me up! Srsly.)