Skip to content

Instantly share code, notes, and snippets.

View ringmaster's full-sized avatar

Owen Winkler ringmaster

View GitHub Profile
SELECT habari__postinfo.value, count(habari__posts.id) from habari__posts
INNER join habari__posttype on habari__posts.content_type = habari__posttype.id and habari__posttype.name = 'page'
inner join habari__postinfo on habari__posts.id = habari__postinfo.`post_id` and `habari__postinfo`.name = 'year'
INNER JOIN habari__poststatus on habari__posts.status = habari__poststatus.id and habari__poststatus.name = 'published'
group by habari__postinfo.value
ORDER BY habari__postinfo.value DESC
@ringmaster
ringmaster / gist:1018904
Created June 10, 2011 14:14
Updated section of the .zshrc file to enable nano-like keybindings
#####################
# SHELL ENVIRONMENT #
#####################
## Ctrl-W stops at a directory
## see http://www.zsh.org/mla/users/1995/msg00088.html
WORDCHARS='*?_-.[]~\!#$%^(){}<>|`@#$%^*()+:?'
## set up my prompt
export PS1="%{${fg[yellow]}%}[%n@%m] %{${fg[green]}%}%3~ %# %{${fg[default]}%}"
#!/bin/bash
# author: Duane Johnson
# email: [email protected]
# date: 2008 Jun 12
# license: MIT
#
# Based on discussion at http://kerneltrap.org/mailarchive/git/2007/11/12/406496
pushd . >/dev/null
@ringmaster
ringmaster / gist:1113751
Created July 29, 2011 12:54
Clients, Client Admins, and Candidates
Background:
Given the following clients exist:
| name | slug | status_id |
| Pickering Valley | pickering-valley | 4 |
| East Ward | east-ward | 4 |
| Shamona Creek | shamona-creek | 4 |
| Brandywine Wallace | brandywine-wallace | 4 |
| Lionville | lionville | 4 |
| Bradford Heights | bradford-heights | 4 |
| Springton Manor | springton-manor | 4 |
@ringmaster
ringmaster / index.js
Created August 3, 2011 13:00 — forked from iamnoah/index.js
Simple node.js webserver with logging. Serves whatever files are reachable from the directory where node is running.
/*
* Copyright (c) 2010 Noah Sloan <http://noahsloan.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
Router::connect(new ValidatingRoute(array(
'template' => '/{:client_slug}',
'params' => array('controller' => 'clients', 'action' => 'show'),
'validator' => function($route, $result) {
return false;
},
)));
/**
* Test matching routes that do not specify HTTP methods against specifically requested methods.
*/
public function testUnspecificMethodBasedMatching() {
$parameters = array('controller' => 'users', 'action' => 'edit');
$route = new Route(array(
'template' => '/nomethod',
'params' => $parameters ));
/**
* Test matching routes based on HTTP method verbs.
*/
public function testMethodBasedMatching() {
$parameters = array('controller' => 'users', 'action' => 'edit');
$route = new Route(array(
'template' => '/method',
'params' => $parameters + array('http:method' => 'POST')
));
<?php
class Izaw extends Mzingi2
{
public function action_add_template_vars($theme) {
parent::action_add_template_vars($theme);
Stack::add('template_stylesheet', array($this->get_url( '/css/new_style.css' )), 'theme');
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8">
<title>My Habari</title>
<meta name="title" content="My Habari">
<meta name="description" content="Tagline?">
<link rel="shortcut icon" href="http://habari.lise/user/themes/izaw/images/favicon.ico">