Skip to content

Instantly share code, notes, and snippets.

View jashmenn's full-sized avatar

Nate Murray jashmenn

View GitHub Profile
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)
From d55b96f257ec52a41a244018cb6e9bc3e62bdd55 Mon Sep 17 00:00:00 2001
From: Nate Murray <nate@natemurray.com>
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
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|
{
#!/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.
@jashmenn
jashmenn / logger_example.rb
Created March 11, 2009 23:11
Module for easy logging in Ruby
# Module for easy logging in Ruby
#
# Example:
#
# class MyClass
# include HasLogger
#
# # ...
# def do_something
# logger.info("I just did something!")
# 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)
[user]
name = Nate Murray
email = email@address
[color]
branch = auto
status = auto
diff = auto
[color "diff"]
meta = yellow
frag = cyan
# .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]
#!/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).
#
# 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