Skip to content

Instantly share code, notes, and snippets.

View mrgenixus's full-sized avatar

Benjamin West mrgenixus

View GitHub Profile
<html>
<head>
<link rel="stylesheet" href="https://raw.github.com/harvesthq/chosen/master/chosen/chosen.css" />
</head>
<body>
<form>
<select name='Organization' class='chzn-select'><option value=''></option><option value='Our Company'></option><option value='Test Company'></option>
</form>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
<script src="https://github.com/harvesthq/chosen/blob/master/chosen/chosen.jquery.js" type="text/javascript"></script>
@mrgenixus
mrgenixus / README.md
Created August 15, 2011 05:41 — forked from davidjbeveridge/README.md
wtf.sh

wtf.sh

A simple search for when you find yourself typing wtf on the command line. Works on mac.

Instructions

Put this somewhere in your path, make it executable, and either rename it to wtf, or create a symlink. Then, whenever you type wtf on the command line, you'll actually get something.

@mrgenixus
mrgenixus / container.php
Created August 30, 2011 15:57
A Generic Container class
<?php
/***************************************************
* Class designed to hold groups of objects
*
* Designed to prevent multiple identical instances
*
***************************************************/
interface Containable
{
/* this returns the value of what an object considers it's index */
@mrgenixus
mrgenixus / strategy.rb
Created January 29, 2012 09:55
Strategy Pattern
class Router
@@routes = {}
@name
attr_accessor :name
def Router.register ( name)
@@routes[name] = self
name
end
def Router.factory (klass_name)
created_route = @@routes[klass_name] || nil
@mrgenixus
mrgenixus / config
Created January 31, 2012 04:05 — forked from davidjbeveridge/Gemfile
Routing
---
BUNDLE_PATH: json
BUNDLE_DISABLE_SHARED_GEMS: '1'
@mrgenixus
mrgenixus / Gemfile
Created March 28, 2012 02:13 — forked from davidjbeveridge/attribute_observers.rb
Attribute Observers
source "http://rubygems.org"
gem "json"
@mrgenixus
mrgenixus / circular_json.rb
Created April 12, 2012 20:16
how do you solve this
#!/usr/bin/env ruby
require 'mongo'
require 'bson'
require 'json'
class Datastore
@db = nil
def initialize (database)
@dbname = database
end
@mrgenixus
mrgenixus / include.rb
Created September 5, 2012 20:34
testing controlled inclusiong
class DataStore < Hash
def store(key,value)
self[key] = value
end
end
module PropertyPlugin
def self.included(base)
@mrgenixus
mrgenixus / directory.php
Created September 24, 2012 07:37
Random file I found on desktop...
<?php
/**
* Template Name: Directory Listing
*/
$dr = realpath(dirname($_SERVER['SCRIPT_FILENAME']));
$document_root = realpath($_SERVER['DOCUMENT_ROOT']);
function relpath($path = null) {
global $dr, $document_root;
if ($path == null || ! strstr(($path = realpath($path)),$document_root) || ! strstr($path,$dr)) return ".";
protean.shortname = protean
protean.longname = Protean
protean.url = http://127.0.0.1
protean.secureurl = http://127.0.0.1
protean.projectdir = /var/www/protean
protean.debugemail = mrgenixus@gmail.com
propel.database = mysql
propel.database.host = localhost
propel.database.user = protean