Skip to content

Instantly share code, notes, and snippets.

View chartjes's full-sized avatar

Chris Hartjes chartjes

View GitHub Profile
Here's my test:
<?php
include 'test_bootstrap.php';
class FranchiseModelTest extends \PHPUnit_Extensions_Database_TestCase
{
protected $_conn;
<?xml version="1.0"?>
<dataset>
<franchise id="1" nickname="BUF" name="Buffalo Thunderherd" conference="AC" division="East" ip="35"/>
<franchise id="2" nickname="COU" name="Chicago Cougars" conference="AC" division="East" ip="35"/>
<franchise id="6" nickname="MCM" name="Motor City Marauders" conference="AC" division="Central" ip="35"/>
<franchise id="10" nickname="PAD" name="Los Angeles Devils of Palo Alto" conference="AC" division="West" ip="35"/>
<franchise id="11" nickname="POR" name="Portland Raptors" conference="AC" division="West" ip="35"/>
<franchise id="15" nickname="MIN" name="Minnesota Snow Bears" conference="NC" division="East" ip="35"/>
<franchise id="3" nickname="KAT" name="Kansas Tornados" conference="AC" division="East" ip="35"/>
<franchise id="7" nickname="PHI" name="Philadelphia Phantasm" conference="AC" division="Central" ip="35"/>
<?xml version="1.0"?>
<dataset>
<franchise id="1" nickname="BUF" name="Buffalo Thunderherd" conference="AC" division="East" ip="35"/>
<franchise id="2" nickname="COU" name="Chicago Cougars" conference="AC" division="East" ip="35"/>
<franchise id="6" nickname="MCM" name="Motor City Marauders" conference="AC" division="Central" ip="35"/>
<franchise id="10" nickname="PAD" name="Los Angeles Devils of Palo Alto" conference="AC" division="West" ip="35"/>
<franchise id="11" nickname="POR" name="Portland Raptors" conference="AC" division="West" ip="35"/>
<franchise id="15" nickname="MIN" name="Minnesota Snow Bears" conference="NC" division="East" ip="35"/>
<franchise id="3" nickname="KAT" name="Kansas Tornados" conference="AC" division="East" ip="35"/>
<franchise id="7" nickname="PHI" name="Philadelphia Phantasm" conference="AC" division="Central" ip="35"/>
Okay, here's what I need:
* I am connected to a remote Ubuntu server using Terminal.app
* I run tmux on the remote server
* I create multiple 'sessions' or 'windows' or 'panes', whatever you want to call them using Ctrl-B c and then move around in them
* I sometimes I have vim open in each of these 'sessions'
* There is contain inside vim session 1 that I want to copy to vim in session 0
How can I do this?
@chartjes
chartjes / gist:1648373
Created January 20, 2012 16:56
Real-time notifications from a task worker
I am using Gearman to import content from a 3rd party via their API. I need the ability to notify users IN REAL TIME that an import of a specific item has failed or been blocked (we only accept MP3's and need to block video imports) or that the Gearman job itself has crashed (there is sometimes wonkiness with MySql deciding it needs to 'go away').
Thoughts and suggestions on how to accomplish this task would be greatly appreciated.
" Vundle manages Vundle!"
Bundle 'gmarik/vundle'
" My bundles go here
" original repos on github"
Bundle "ervandew/supertab"
Bundle "garbas/vim-snipmate"
Bundle 'honza/snipmate-snippets'
Bundle 'Lokaltog/vim-powerline'
var EventEmitter = require('events').EventEmitter;
var util = require('util');
var Ticker = function(){};
util.inherits(Ticker, EventEmitter);
Ticker.prototype.tick = function() {
self = this;
interval = setInterval(function() {
@chartjes
chartjes / gist:1711104
Created January 31, 2012 15:34
Hands On Node File System Exercise #3
var fs = require('fs');
function readBytes(filePosition, length) {
var readFile = function(err, fd) {
if (err) {
console.log(err.message);
return;
}
var readBuffer = new Buffer(length);
I need help extracting some info using a regex in PHP.
I have a string is like this
[email protected]
-> foo can change but is always lowercase alpha, variable length
-> tmp is ALWAYS tmp
-> uniqid is always lowercase alpha plus 0 to 9, output from uniqid() function
-> moontoast.com is ALWAYS moontoast.com
I am using this composer.phar file
{
"name": "api.ibl.org",
"version": "0.0.1",
"repositories": {
"slim repo": {
"package": {
"name": "codeguy/slim",
"version": "1.5.1",