Skip to content

Instantly share code, notes, and snippets.

View virtualstaticvoid's full-sized avatar

Chris Stefano virtualstaticvoid

View GitHub Profile
@virtualstaticvoid
virtualstaticvoid / chosen-bootstrap.css
Created June 30, 2012 18:21 — forked from rabu81/chosen-bootstrap.css
overwrite chosen styling to look like bootstrap
/*
* add this to your own css file,
* to overwrite the _chosen_ styling, to look more like bootstrap!
*
* note: for the error part to work, an .error class-name must be added
* to a wrapping DIV, to display the bootstrap error styling. I have
* just use the wrapping .control-group DIV
*
* credit: Rasmus Burkal, @rabu81
*/
@virtualstaticvoid
virtualstaticvoid / databases.rake
Created May 11, 2012 20:41 — forked from wbailey/databases.rake
ActiveRecord migrations outside of Rails
require 'yaml'
require 'logger'
require 'active_record'
namespace :db do
def create_database config
options = {:charset => 'utf8', :collation => 'utf8_unicode_ci'}
create_db = lambda do |config|
ActiveRecord::Base.establish_connection config.merge('database' => nil)
@virtualstaticvoid
virtualstaticvoid / git-reset-modes
Created March 22, 2012 00:15
Resets file modes in Git
#!/bin/bash
git diff --numstat | awk '{if ($1 == "0" && $2 == "0") print $3}' | xargs git checkout HEAD
@virtualstaticvoid
virtualstaticvoid / redis_pubsub_demo.rb
Created March 18, 2012 18:44 — forked from pietern/redis_pubsub_demo.rb
Simple demo to showcase Redis PubSub with EventMachine
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
@virtualstaticvoid
virtualstaticvoid / reset_mouse
Created February 29, 2012 13:46
Ubuntu 11+ - Reset mouse (if frozen)
#!/bin/bash
sudo rmmod psmouse && sudo modprobe psmouse
@virtualstaticvoid
virtualstaticvoid / remove_global_menu
Created February 29, 2012 13:44
Ubuntu 11+ Remove Global Menu
#!/bin/bash
sudo apt-get remove appmenu-gtk3 appmenu-gtk appmenu-qt
@virtualstaticvoid
virtualstaticvoid / default.tint2rc
Last active November 12, 2020 16:09
Tint2 Configuration
# Tint2 config file
# Generated by tintwizard (http://code.google.com/p/tintwizard/)
# For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure
# Background definitions
# ID 1
rounded = 3
border_width = 0
#background_color = #000000 60
background_color = #000000 80
@virtualstaticvoid
virtualstaticvoid / Backup and download database backup
Created January 19, 2012 15:27
Automate Heroku database backups
#!/bin/bash
#
# Script to create and download a database backup on Heroku
# Written by Chris Stefano (https://github.com/virtualstaticvoid)
#
# See http://devcenter.heroku.com/articles/pgbackups for details
#
appname=$1
filename=${appname}_db_$(date +%Y%m%d)_$(date +%H%M).pg_backup
@virtualstaticvoid
virtualstaticvoid / domain.rb
Created December 30, 2011 15:55 — forked from erikrozendaal/domain.rb
Simple Ruby DSL for CQRS+ES aggregates
# CQRS+ES Domain DSL
class Symbol
def snake_case
to_s.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
gsub(/([a-z\d])([A-Z])/, '\1_\2').
tr("-", "_").
downcase.to_sym
end
@virtualstaticvoid
virtualstaticvoid / nginx.conf
Created September 5, 2011 06:32 — forked from thewebfellas/nginx.conf
sample nginx.conf for thin
user nginx;
worker_processes 5;
error_log /var/log/nginx.error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}