Skip to content

Instantly share code, notes, and snippets.

View steckel's full-sized avatar

Curtis Steckel steckel

  • San Francisco, CA
View GitHub Profile
@steckel
steckel / $.fn.getInlineStyleObject()
Created December 9, 2011 19:18
A helpful little JQuery plugin I adapted from http://jsfiddle.net/ZcEUL/
$.fn.getInlineStyleObject = function() {
var $element, prop, props, rprops, str, styleObject, _i, _len;
$element = this;
str = $element.attr("style");
rprops = /[\w-]+(?=:)/g;
props = str.match(rprops);
styleObject = {};
for (_i = 0, _len = props.length; _i < _len; _i++) {
prop = props[_i];
if ($element[0].style[prop] != null) {
@steckel
steckel / CoffeeScript.md
Created November 17, 2011 22:31
An introduction to CoffeeScript

CoffeeScript

A little language that compiles into JavaScript.

JavaScript is kind of a big deal.

The web was not built for the interactivity we have come to expect of it. Web pages were originally designed to contain static text and images. Hyperlinks were a way to travel between these static pages but, that was the extent of a page's interactivity.

Java and JavaScript emerged as competitors (Java is to JavaScript as Car is to Carpet) in web browsers promising to add a new level of dynamic content and interactivity.

@steckel
steckel / simpleAssServer.coffee
Created September 30, 2011 19:53
Just a, stupid, simple executable coffeescript that'll serve up a folder on your filesystem
#!/usr/bin/env coffee
sys = require "sys"
http = require "http"
url = require "url"
path = require "path"
fs = require "fs"
argv = process.argv