This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def keep_splitting(values) | |
return if values.empty? | |
if values.include?(true) && values.include?(false) | |
puts | |
puts "Values" | |
p values | |
puts "have a mixture, keep splitting" | |
column_2 = (column_1 = values.dup).slice!(0, values.size/2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From d55b96f257ec52a41a244018cb6e9bc3e62bdd55 Mon Sep 17 00:00:00 2001 | |
From: Nate Murray <[email protected]> | |
Date: Mon, 2 Mar 2009 09:23:20 -0800 | |
Subject: [PATCH] added autosession to etabs | |
--- | |
vimrc | 1 + | |
1 files changed, 1 insertions(+), 0 deletions(-) | |
diff --git a/vimrc b/vimrc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Order | |
has_many :order_order_properties, :dependent => :destroy, | |
:attributes => true | |
has_many(:properties, :class_name => "OrderProperty", | |
:through => :order_order_properties, | |
:source => :order_property) | |
named_scope :with_property_value, lambda { |property_name, value| | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script will kill all the child process id for a given pid | |
#Store the current Process ID, we don't want to kill the current executing process id | |
CURPID=$$ | |
# This is process id, parameter passed by user | |
ppid=$1 | |
if [ -z $ppid ] ; then | |
echo No PID given. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Module for easy logging in Ruby | |
# | |
# Example: | |
# | |
# class MyClass | |
# include HasLogger | |
# | |
# # ... | |
# def do_something | |
# logger.info("I just did something!") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# an example of using ruby soap that will actually work. | |
# | |
# Modified from: http://rpheath.com/posts/298-consuming-soap-services-in-ruby | |
require 'soap/wsdlDriver' | |
require 'pp' | |
class SoapWrapper | |
attr_accessor :endpoint, :service | |
def initialize(endpoint=nil, service=nil) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Nate Murray | |
email = email@address | |
[color] | |
branch = auto | |
status = auto | |
diff = auto | |
[color "diff"] | |
meta = yellow | |
frag = cyan |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .htaccess file to redirect a hosted mediawiki with ugly urls to another server with pretty urls. | |
# Assumed that this is in a .htaccess file in in, say, the "mediawiki" directory. | |
# the rules change if it was in a server config. | |
Options +FollowSymlinks | |
RewriteEngine On | |
RewriteCond %{QUERY_STRING} title=(.*) | |
RewriteRule ^index.php(.*) http://wiki.mydomain.com/%1? [R,L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This file echoes a bunch of color codes to the | |
# terminal to demonstrate what's available. Each | |
# line is the color code of one forground color, | |
# out of 17 (default + 16 escapes), followed by a | |
# test use of that color on all nine background | |
# colors (default + 8 escapes). | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configuration for testing | |
pool(:test_clouds) do | |
port 80 | |
ami "ami-1cd73375" # Alestic's base ubuntu AMI #ami "ami-f9967190" # OPC ami, based on Alestic's base ubuntu AMI | |
availability_zone "us-east-1a" | |
keypair "test_clouds_app" | |
cloud(:app) do | |
security_group 'test' | |
instances 1 |