Skip to content

Instantly share code, notes, and snippets.

View al-the-x's full-sized avatar

David Rogers AKA "AL the X" al-the-x

View GitHub Profile
@al-the-x
al-the-x / .tmuxrc
Created May 10, 2011 20:11 — forked from xentek/.tmux.conf
custom .tmux.conf (renamed to .tmuxrc) file for your multiplexing pleasure
###
# Custom tmux configuration cobbled together from google and trial & error
# by Eric Marden (xentek.net), heavily modified by David Rogers (@al-the-x).
##
# set the command prefix to match gnuscreen (i.e. CTRL+a)
set-option -g prefix C-a
# use the NEW prefix key to "send-prefix" instead of the default
unbind-key C-b; bind-key C-a send-prefix
@derwiki
derwiki / javascript-for-vim-refactoring.js
Created May 29, 2013 15:08
Moving faster with Vim (5-minute lightning talk presentation). I wasn't inspired to learn effective command of Vim until I saw some people flying around faster than I thought was possible. The goal of this presentation is to call out how slow "normal" text editing is, and how many keystrokes can be reduced by using increasingly more terse Vim co…
$(function() {
// good opportunity to combine into a single statement
// qq w cw <esc> A, <esc> 0 j q
var a = 10;
var b = 20;
var c = 30;
var d = 40;
var e = 50;
// opportunity to simplify syntax
@webaware
webaware / flxmap-no-rocketscript.php
Last active January 31, 2020 16:29
stop CloudFlare Rockscript messing up WP Flexible Map plugin!
<?php
/*
Plugin Name: Flxmap No Rocketscript
Plugin URI: https://gist.github.com/webaware/8949605
Description: stop CloudFlare Rockscript messing up the map plugin!
Version: 3
Author: WebAware
Author URI: http://webaware.com.au/
@ref: http://wordpress.org/support/topic/map-wont-appear
@al-the-x
al-the-x / FunctionalTestCase.php
Last active August 29, 2015 14:04
I get tired of writing this simple `FunctionalTestCase` over and over again. I should submit to @sbergmann for PHPUnit...
<?php
/**
* A "functional" test is typically one that runs the full application through it's
* paces: constructing a request, triggering a route, generating a response, and
* testing the fully rendered output. This abstract class provides some assertions
* appropriate for testing requests and responses and abstract methods for actually
* fetching requests and responses and routing the application. The developer should
* extend this class for his or her specific framework or application.
*/
@al-the-x
al-the-x / check-writing.js
Created October 2, 2014 15:33
Practiced Kata: Check Writing from @TheIronYard--Orlando
var assert = require('assert');
function test(actual, expected, success){
success = success || 'pass!';
assert.equal(actual, expected);
console.log(success);
}
@al-the-x
al-the-x / .bowerrc
Last active August 29, 2015 14:08
Starting point for Coding Dojos in JavaScript using Mocha and Chai
{
"scripts": {
"postinstall": "./node_modules/.bin/wiredep -s index.html"
}
}
@al-the-x
al-the-x / conway.py
Created November 16, 2014 23:13
Implementation of Conway's Game of Life in Python for a potentially infinite board using the `doctest` module: `python -m doctest conway.py`
def coalesce(*args):
return next((a for a in args if a is not None), None)
class Game(dict):
_xmin = _xmax = _ymin = _ymax = None
@property
def bounds(self):
"""
>>> Game((0,0)).bounds
@timwco
timwco / ghregex.js
Last active December 9, 2016 20:52
Github to GH Pages to Github Bookmarklet
/*
Takes you from a Github Repo URL to the GH Pages version on github.io
*/
javascript: (function() {
var s = location.href;
var r = /^((http[s]?|ftp):\/)?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+[^#?\s]+)(.*)?(#[\w\-]+)?$/g;
location.href = s.replace(r, "http:/$5.github.io/$6");
})();
// URL Encoded Version (for use as a bookmarklet)
@rtablada
rtablada / .chrome-awards
Last active August 29, 2015 14:24
Opens specific sites in Chrome from the CLI
alias updatechrome='source ~/chrome-awards'
alias chrome='/usr/bin/open -a "/Applications/Google Chrome.app"'
googlethat() {
chrome 'http://google.com?q='$1
}
alias themoreyouknow="chrome 'http://ak-hdl.buzzfed.com/static/2015-02/1/20/enhanced/webdr02/anigif_enhanced-buzz-20392-1422840785-34.gif'"
@al-the-x
al-the-x / rovarspraket.js
Created September 18, 2015 19:37
Coding Dojo @ TIY-Durham on 2015-09-18 with 2015-FALL-FEE!
var expect = require('chai').expect;
/**
* write a function `max` that takes two `Numbers` as arguments
* and returns the largest of them. HINT: Use `if-else`...!
*/
it('should calculate the max of two Number', function(){
// expect(max(1,3)).to.be.equal(3);
expect(max(2,4)).to.be.equal(4);
expect(max(2,6)).to.be.equal(6);