Skip to content

Instantly share code, notes, and snippets.

(evil-define-state god
"God state."
:tag " <G> "
:message "-- GOD MODE --"
:entry-hook (evil-god-start-hook)
:exit-hook (evil-god-stop-hook)
:input-method t
:intercept-esc nil)
(defun evil-god-start-hook ()
.ruby-version
.php-version
*.swp
*.swo
*.un~
# Compiled source #
###################
*.class
*.dll
# This tmux statusbar config was created by tmuxline.vim
# on Thu, 09 Jan 2014
set -g status-bg 'colour238'
set -g message-command-fg 'colour249'
set -g status-justify 'left'
set -g status-left-length '100'
set -g status 'on'
set -g pane-active-border-fg 'colour150'
set -g message-bg 'colour237'

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@shuber
shuber / _test.rb
Created November 5, 2012 08:14 — forked from jcoglan/_test.rb
Rooby - ruby object system in ruby
$VERBOSE = nil
require File.expand_path('../rooby', __FILE__)
Person = Rooby::Class.new 'Person' do
define :initialize do |name|
@name = name
end
define :name do
@shuber
shuber / main.cpp
Created March 14, 2012 05:28 — forked from betawaffle/main.cpp
Number to Words
#include <iostream>
#include <ctime>
#include <string>
using namespace std;
string convert(unsigned long n) {
static char *formats[16] = {
"", "%s%s%s", "%s%s", "%s%s-%s",
"%s hundred", "%s hundred and %s%s", "%s hundred and %s", "%s hundred and %s-%s",
@shuber
shuber / attr_encrypted_test.rb
Created November 3, 2011 23:08
attr_encrypted test
require 'rubygems'
require 'attr_encrypted'
class User
attr_encrypted :last_name, :key => 'my super secret key'
def initialize(last_name)
self.last_name = last_name
end
end
@shuber
shuber / load_eval.rb
Created September 28, 2011 04:36
LoadEval proof of concept
module LoadEval
class << self
def contexts
@contexts ||= []
end
def load_within_context(object, file)
contexts << [object, file]
load('load_eval_proxy.rb', true)
ensure
@shuber
shuber / attr_encrypted_with_ar_2.1.2.rb
Created April 2, 2010 18:13
Testing attr_encrypted with ActiveRecord 2.1.2
require 'rubygems'
require 'test/unit'
gem 'activerecord', '2.1.2'
require 'active_record'
require 'attr_encrypted'
ActiveRecord::Base.establish_connection :adapter => 'sqlite3', :database => ':memory:'
@shuber
shuber / connection_manager.php
Created January 15, 2010 19:42
a simple php database connection manager
<?php
abstract class ConnectionManager {
static $configurations = array();
static $connections = array();
static function &connection($name) {
if (!isset(self::$connections[$name])) self::establish_connection($name);
return self::$connections[$name];