Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script>
<!--[if lt IE 9]><script src="/_assets/js/html5-shiv.js"></script><![endif]-->
<link rel="stylesheet" href="/_assets/css/styles.css" media="all" />
<!--[if IE]><link rel="stylesheet" href="/_assets/css/ie.css" media="all" /><![endif]-->
@robflaherty
robflaherty / LICENSE
Created June 18, 2011 15:31 — forked from hugs/LICENSE
The Node.js "Hello World" web server ported to CoffeeScript
I, Jason Huggins, the author of the work "CoffeeScript Web Server" (2010), irrevocably renounce
all current and future legal rights to the work in any medium whatsoever.
I stand behind the merit of the work, but disclaim all liability for it under law.
I encourage you, the audience, to share, copy, distribute, perform, remix, mash up, interpret,
excerpt, translate, and otherwise enjoy and use the work as you will.
I request that you acknowledge my authorship.
var app = (function(testMode) {
//Private methods
var method1 = function() {};
var method2 = function() {};
//Public methods
var method3 = function() {};
var method4 = function() {};
@robflaherty
robflaherty / gist:1129871
Created August 6, 2011 23:14
CoffeeScript and Stylus watch/build cakefile
# CoffeeScript and Stylus watch/build cakefile
{spawn, exec} = require 'child_process'
task 'assets:watch', 'Watch source files and build JS & CSS', (options) ->
runCommand = (name, args...) ->
proc = spawn name, args
proc.stderr.on 'data', (buffer) -> console.log buffer.toString()
proc.stdout.on 'data', (buffer) -> console.log buffer.toString()
proc.on 'exit', (status) -> process.exit(1) if status isnt 0
@robflaherty
robflaherty / gist:1129904
Created August 7, 2011 00:00
Stylus conversion of Normalize.css
/*
* Normalize.css converted to Stylus
* http://github.com/necolas/normalize.css
*/
article, aside, details, figcaption, figure, footer, header, hgroup, nav, section
display: block
audio, canvas, video
display: inline-block
@robflaherty
robflaherty / gist:1153058
Created August 18, 2011 01:09
concatenate js with php example
<?php
header('Content-type: application/javascript');
$files = array(
//Plugins
dirname(__FILE__) . '/plugins/jquery.hoverIntent.min.js',
dirname(__FILE__) . '/plugins/jquery.placeholder.min.js',
dirname(__FILE__) . '/plugins/jquery.form.min.js',
dirname(__FILE__) . '/plugins/jquery.tabs.min.js',
dirname(__FILE__) . '/plugins/jquery.tweet.min.js',
$elem = $html->find('.c3');
$elem->outertext = '<strong>' . $elem->outertext . '</strong>';
@robflaherty
robflaherty / csv-to-json.php
Created September 1, 2011 02:26
Convert CSV to JSON
<?php
/*
* Converts CSV to JSON
* Example uses Google Spreadsheet CSV feed
* csvToArray function I think I found on php.net
*/
header('Content-type: application/json');
// Set your CSV feed
@robflaherty
robflaherty / gist:1348477
Created November 8, 2011 17:35
IE styles copying to clipboard

In IE8 and IE9, copy/pasting into Microsoft Word produces different results depending on the order of the class names specified in the HTML. In the first case, the display: none declaration is copied to the Clipboard; in the second case it is omitted.

JSFiddle: http://jsfiddle.net/sBthg/4/

Thoughts?

@robflaherty
robflaherty / pump-up-the-font.js
Created December 11, 2011 16:37
WordPress fullscreen mode type enhancing bookmarklet
/*
* WordPress offers a wonderful minimalist fullscreen editing mode but the text is too small for my taste. You can use this bookmarklet
* to pump up the font-size and line-height to something more pleasurable.
*/
javascript:(function(){
var iframe = document.getElementById('wp_mce_fullscreen_ifr'),
tinymce = iframe.contentWindow.document.getElementById('tinymce');
tinymce.style.fontSize = '18px';