Skip to content

Instantly share code, notes, and snippets.

View eculver's full-sized avatar
🧠
Braining

Evan Culver eculver

🧠
Braining
View GitHub Profile
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>My Framework</title>
</head>
<body>
/* Use this to cause a function to fire no more than once every 'ms' milliseconds.
For example, an expensive mousemove handler:
$('body').mouseover(ratelimit(function(ev) {
// ...
}, 250));
*/
function ratelimit(fn, ms) {
var last = (new Date()).getTime();
@eculver
eculver / css color + text shadow
Created April 28, 2010 19:58
css color + text shadow
/* http://www.newthink.net */
color: #2a2a2a;
text-shadow: rgba(0, 0, 0, 0.113281) 2px 2px 0px;
/* http://ozmm.org */
color: red;
text-shadow: #0c0c0c 2px 2px 1px;
/* http://peroty.tumblr.com */
color: #f2e3c6;
<!doctype html>
<html>
<head>
<title>Test Page</title>
</head>
<body class="yui3-skin-sam">
<h1>Getting notification that a form is &quot;dirty&quot;</h1>
<p>This is an incomplete YUI 3.2 (post pr1) solution to monitoring whether a form has had any of its field values modified. It has only been tested against the given markup, and it doesn't address updating values programmatically.</p>
<form id="formId" action="">
<input type="text" name="text">
(function () {
try {
if (!google.doodle) google.doodle = {};
var a = 200,
g = -200,
j = -200,
k, l, m, n = 0,
o = 0,
p = 0,
q = 35,
@rphillips
rphillips / 256-colors
Created October 19, 2010 16:39
.tmux.conf
# Key Default Action
# h,| % Split window horizontally
# v,- " Split window vertically
# C-s o Go to next pane
# x x Kill the active pane
# q q Show pane numbers
# A-Arrow Key Resize the active pane
# C-Arrow Key Resize the active pane by one line or on character
#
unbind C-b
window.addEventListener "DOMContentLoaded", ->
body = $ "body"
canvas = $ "#canvas"
chalkboard = $ "#chalkboard"
close = $ "#close"
ledge = $ "#ledge"
lightswitch = $ "#lightswitch"
output = $ "#output"
shade = $ "#shade"
share = $ "#share"
@ryanflorence
ryanflorence / static_server.js
Last active April 26, 2024 16:18
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@JangoSteve
JangoSteve / ubuntu_rails_install.rb
Created January 22, 2011 17:58
Capistrano script to install Ruby, RVM, Rails in ubuntu (modified from deploy.rb scripts)
namespace :ubuntu do
desc "Setup Environment"
task :setup_env, :roles => :app do
update_apt_get
install_dev_tools
install_git
install_subversion
install_sqlite3
# Install and setup RVM instead of old Rails stack
#install_rails_stack
@jefftriplett
jefftriplett / pyhowl.py
Created September 20, 2011 05:36
Post to Howl (http://howlapp.com) from Python
"""
pyhowl - Post to Howl (http://howlapp.com)
Copyright (c) 2011, Jeff Triplett
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,