Skip to content

Instantly share code, notes, and snippets.

@kennyp
kennyp / .bashrc
Created January 16, 2013 17:45
Help for early space.
gi () {
local cmd=$1
shift 1
cmd=$(echo $cmd | sed -e 's/^t//')
git $cmd $@
}
@kennyp
kennyp / text.svg
Created September 13, 2012 19:03
Playing with SVG text.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kennyp
kennyp / employee.sql
Created August 23, 2012 20:27
Because there is not a decent limit clause in MSSQL.
SELECT
*
FROM (
SELECT
ROW_NUMBER() OVER (ORDER BY last_name asc) AS RowNum,
phppos_people.*,
phppos_employees.username,
phppos_employees.deleted
FROM phppos_people
JOIN phppos_employees ON
@kennyp
kennyp / keys.js
Created August 10, 2012 20:32
Key Sequences
/*jslint plusplus: true, continue: true */
/*global define: false, alert: false */
function trimString(str) {
'use strict';
str = str.replace(/^\s\s*/, '');
var ws = /\s/,
i = str.length;
while (ws.test(str.charAt(--i)));
return str.slice(0, i + 1);
}
@kennyp
kennyp / diff.diff
Created August 9, 2012 16:23
Carzyness
diff --git a/themes/comporium/js/sales.js b/themes/comporium/js/sales.js
index 95e84f6..3c47286 100644
--- a/themes/comporium/js/sales.js
+++ b/themes/comporium/js/sales.js
@@ -201,10 +201,15 @@ var init = function ($, Complete, Cart, queue) {
this.registerEvents();
$('script[type="text/underscore-template"]').forEach(function (t) {
- var pn = $(t).parent(),
+ var parNo = t.parentNode,
@kennyp
kennyp / test.hs
Created July 31, 2012 19:39
Playing with SDL
module TestSDL where
import qualified Graphics.UI.SDL.General as SDLG
import Graphics.UI.SDL.Joystick (countAvailable, tryName)
main = do
SDLG.init [SDLG.InitJoystick]
name <- tryName 0
case name of
@kennyp
kennyp / after.js
Created July 30, 2012 17:57
Pattern match or no?
JobQueue.prototype.nextJob = function () {
var that = this;
match(this.queue.shift(), {
'string': function (url) {
$.ajax(url, function () {
that.nextJob();
});
},
'function': function (callback) {
callback(function () {
@kennyp
kennyp / home.js
Created July 19, 2012 19:32
Main JS file for our setup?
/*jslint browser: true, regexp: true */
/*global define: false */
define(['require'], function (require) {
'use strict';
return {
init: function () {
}
};
@kennyp
kennyp / deploy.rb
Created July 6, 2012 02:08
Capistrano PHP
#################################################################
#################################################################
#
# This is a sample Capistrano deployment recpie for use with
# deploying PHP applications. For more information please visit:
#
# http://www.lengelzigich.com
# http://www.capify.org
@kennyp
kennyp / virtualhosts.conf
Created July 2, 2012 17:53
/etc/httpd/conf.d/
NameVirtualHost *:80
Include conf.d/vihosts.d/*.conf
<VirtualHost *:80>
ServerName cashier-dev.comporium.com
ServerAlias *
DocumentRoot /var/ww/cashier/current
DirectoryIndex index.php index.html
<Directory "/var/www/cashier/current">