Skip to content

Instantly share code, notes, and snippets.

View qrush's full-sized avatar
🕸️
Making internets

Nick Quaranto qrush

🕸️
Making internets
View GitHub Profile
#!/bin/sh
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis.pid
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
# 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.)
fib = [1, 2]
while fib.last < 4_000_000
fib << fib[-1] + fib[-2]
end
fib.each do |f|
puts f if f % 2 == 0
end
From ff49afda3beb5bb20dd43f05e301bee7b3c57a06 Mon Sep 17 00:00:00 2001
From: John Trupiano <jtrupiano@gmail.com>
Date: Sat, 16 Jan 2010 15:17:10 -0500
Subject: [PATCH 3/3] Don't allow database access in rails3
* Override Stub#class to return a dup'd class instance that mocks #active_relation
---
lib/factory_girl/proxy/stub.rb | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
## monit.d/memcached.monitrc
check process memcached
group memcached
with pidfile /var/run/memcached/memcached.pid
start program = "/etc/init.d/memcached start"
stop program = "/etc/init.d/memcached stop"
if failed port 11211 4 times within 5 cycles then restart
if 4 restarts within 5 cycles then timeout
depends on memcached_bin
@qrush
qrush / hubcut
Created October 28, 2009 22:10 — forked from pivotal-legacy/hubcut
#!/usr/bin/env ruby
# This script copies all .gem files for all versions of a gem from gems.github.com to gemcutter.org.
# For all versions of a gem, it does a gem fetch, repackages the gem with the non-namespaced name,
# and does a gem push. You must have permission to push the gem, so your gemcutter key must be
# set in ~/.gemrc
require 'rubygems'
require 'yaml'
require 'fileutils'
---
:environment:
SERVER_NAME: localhost
PATH_INFO: /
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.9) Gecko/2009040820 Firefox/3.0.9
HTTP_ACCEPT_ENCODING: gzip,deflate
rack.url_scheme: http
HTTP_HOST: localhost:4567
HTTP_ACCEPT_LANGUAGE: en-us,en;q=0.5
HTTP_CACHE_CONTROL: max-age=0
@qrush
qrush / _gem
Created August 10, 2009 20:11 — forked from alexvollmer/_gem
#compdef gem gem1.9
gem_general_flags=("(-h --help)"{-h,--help}"[Get help on this command]"
"(-V --verbose)"{-V,--verbose}"[Set the verbose level of output]"
"(-q --quiet)"{-q,--quiet}"[Silence commands]"
"--config-file[Use this config file instead of default]:file:_files"
"--backtrace[Show stack backtrace on errors]"
"--debug[Turn on Ruby debugging]"
$nul_arg
)
--type-add=ruby=.haml,.rake,.rsel,.builder
--type-add=html=.html.erb,.html.haml
--type-add=js=.js.erb
--type-add=css=.sass
--type-set=cucumber=.feature
--ignore-dir=vendor
--ignore-dir=log
--ignore-dir=tmp
--ignore-dir=doc
--ignore-dir=coverage