Skip to content

Instantly share code, notes, and snippets.

@drewlesueur
drewlesueur / how_to_use_screen.md
Created May 1, 2011 02:26
How to use linux screen
$('.vidstack').click(function(){
$(iframe).attr('src',$(this).attr("data-url"));
})
@drewlesueur
drewlesueur / sync_forked.md
Created April 17, 2011 04:28
How to sync your forked branch

This is how I synced my forked underscore.js repo with the original repo
From your forked repo:

git checkout -b upstream/master
git remote add upstream git://github.com/documentcloud/underscore.git
git pull upstream master
git checkout master                          // [my master branch]
git merge upstream/master (git rebase upstream/master ????)
git push origin master
x = 1
log x
log "hello #{name}"
@drewlesueur
drewlesueur / test.md
Created January 28, 2011 06:21
markdown

|test|table| |another| test|

@drewlesueur
drewlesueur / jqueryui.js
Created January 22, 2011 21:36
jQuery UI
/*!
* jQuery UI 1.8.9
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI
*/
(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.9",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,
@drewlesueur
drewlesueur / explicit_scope.md
Created January 8, 2011 02:55
Explicit scope in JavaScript

Explicit Scope in JavaScript

Wouldn't it be cool if JavaScript had explicit scope?

Every function would have an extra scope variable that represents the scope of that function.

Example

function update_scope(s) {

s.name = "Bob"

@drewlesueur
drewlesueur / util.php
Created December 29, 2010 19:27
A couple PHP utility functions
// Disable magic quotes
if (get_magic_quotes_gpc()) {
$process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
while (list($key, $val) = each($process)) {
foreach ($val as $k => $v) {
unset($process[$key][$k]);
if (is_array($v)) {
$process[$key][stripslashes($k)] = $v;
$process[] = &$process[$key][stripslashes($k)];
} else {
<!doctupe html>
<html>
<head>
<title> ABC
</title>
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<script src="http://includes.the.tl/zepto/zepto.js"></script>
<script src="http://includes.the.tl/underscore.js"></script>
@drewlesueur
drewlesueur / expresscgi.coffee
Created December 20, 2010 03:01
Example of using the express framework as cgi instead of running on a node server!
#!/usr/bin/env coffee
cgi = require "/root/sites/coffee-cgi/cgi"
sys = require "sys"
http = require "http"
http.IncomingMessage = cgi.Request
http.ServerResponse = cgi.Response
connect = require "connect"