Skip to content

Instantly share code, notes, and snippets.

View loonies's full-sized avatar
👨‍💻
Working full time

loonies

👨‍💻
Working full time
View GitHub Profile
# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html
Hi everyone, I'm Chris Wanstrath.
When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But
then I took a few moments and thought, Wait, why? Why me? What am I supposed
to say that's interesting? Something about Ruby, perhaps. Maybe the
future of it. The future of something, at least. That sounds
keynote-y.
@jwage
jwage / SplClassLoader.php
Last active April 9, 2024 21:04
Add MIT license.
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
@treffynnon
treffynnon / jQuery Using and Manipulating Select Lists.js
Created February 4, 2010 15:19
jQuery: Using and Manipulating Select Lists
//Get the currently selected option's value
$(this).val();
//Get the currently selected option's title
$(this).text();
//Set the currently selected option to the supplied value
$(this).val('value');
//Get an option with a specified value
<?php
$depth = 0;
echo '<ol class="tree">';
foreach ($children as $i => $child)
{
// Get the last and next nodes
$last = isset($children[$i-1]) ? $children[$i-1] : $children[0];
$next = isset($children[$i+1]) ? $children[$i+1] : $children[0];
<?php
Route::set('feed', 'feed<format>', array('format' => '\.\w+'))
->defaults(array(
'controller' => 'feed',
));
Route::set('article', 'article(s)/<article>(<format>)', array('format' => '\.\w+'))
->defaults(array(
$(document).ready(function() {
$('form').live('submit', function()
{
var form = $(this);
var action = form.attr('action');
$.post(action, form.serialize(), function(response)
{
form.replaceWith(response);
@shadowhand
shadowhand / install-kohana.sh
Created November 8, 2010 06:29
A script to install the Kohana PHP Framework
#!/bin/sh
# have submodules been added?
MODS=0
# Github base URL
GITHUB="https://github.com"
# Default branch
DEFAULT_BRANCH="3.0/master"
#!/bin/sh
# have submodules been added?
MODS=0
# Github base URL
GITHUB="https://github.com"
# Default branch
DEFAULT_BRANCH="3.0/master"
<?php defined('SYSPATH') or die('No direct script access.');
class View {
public static function factory($template, array $partials = NULL)
{
$class = 'View_'.str_replace('/', '_', $template);
if ( ! class_exists($class))
{
@cbandy
cbandy / curl.php
Created March 10, 2011 20:57
cURL wrapper object
<?php
/**
* Wrapper around PHP's procedural API
*/
class Kohana_cURL
{
public static function factory(string $url = NULL)
{
// Raises E_WARNING upon error