Skip to content

Instantly share code, notes, and snippets.

View devongovett's full-sized avatar

Devon Govett devongovett

View GitHub Profile
require 'tweakSiri'
require 'siriObjectGenerator'
#######
# This is a "hello world" style plugin. It simply intercepts the phrase "text siri proxy" and responds
# with a message about the proxy being up and running. This is good base code for other plugins.
#
# Remember to add other plugins to the "start.rb" file if you create them!
######
/*
* Minimal classList shim for IE 9
* By Devon Govett
* MIT LICENSE
*/
if (!("classList" in document.documentElement) && Object.defineProperty && typeof HTMLElement !== 'undefined') {
Object.defineProperty(HTMLElement.prototype, 'classList', {
get: function() {
<!DOCTYPE html>
<html>
<head>
<title>WebSocket test</title>
</head>
<body>
<script src="http://localhost:8080/socket.io/socket.io.js"></script>
<script>
var server = 'smtp.example.com',
port = 587,
#
# Hyphenator - a fast hyphenation algorithm
# By Devon Govett
# MIT LICENSE
#
# Based on:
# 1. The algorithm described by Frank Liang and used in TeX - http://tug.org/docs/liang/liang-thesis.pdf
# 2. Hyphenator.js - http://code.google.com/p/hyphenator
# 3. Hypher.js - https://github.com/bramstein/Hypher/
#
@devongovett
devongovett / columns.coffee
Created August 17, 2011 01:49
PDFKit examples 3
loremIpsum = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam in...'
doc.text loremIpsum, columns: 2
###
# An implementation of the msgpack serialization format - http://msgpack.org/
# By Devon Govett
# MIT LICENSE
###
class MsgPack
idx = 0
@pack: (data, byteArray = false) ->
function getElementsByClassName(oElm, strTagName, strClassName){
var arrElements = (strTagName == "*" && oElm.all)? oElm.all :
oElm.getElementsByTagName(strTagName);
var arrReturnElements = new Array();
strClassName = strClassName.replace(/\-/g, "\\-");
var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
var oElement;
for(var i=0; i<arrElements.length; i++){
oElement = arrElements[i];
if(oRegExp.test(oElement.className)){
class Test
method: ->
setTimeout ->
super
# ...
, 10
@devongovett
devongovett / CSSTransform.coffee
Created August 4, 2011 20:15
WebKitCSSTransform for all browsers
class CSSTransform
constructor: ->
@m11 = @m22 = @m33 = @m44 = 1
@m12 = @m13 = @m14 = 0
@m21 = @m23 = @m24 = 0
@m31 = @m32 = @m34 = 0
@m41 = @m42 = @m43 = 0
if arguments.length
@setMatrix arguments...