Skip to content

Instantly share code, notes, and snippets.

View thrashr888's full-sized avatar
🐮
moo

Paul Thrasher thrashr888

🐮
moo
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<script>
// 238!
function L(U,C){var d=document,f='firstChild',r='readyState',h=d.documentElement[f],s=d.createElement('script'),m=s[r]?'onreadystatechange':0;s.src=U;s[m||'onload']=function(){if(!m||/ded|te/.test(s[r]))s[m]=0,C()}h.insertBefore(s,h[f])}
// async loading of javascript files, starting asap.
L("http://example.com/example.js",function () {
doSomething();
require 'open-uri'
# url dsl -- the ultimate url dsl!
#
# You just can't beat this:
#
# $ irb -r url_dsl
# >> include URLDSL
# => Object
# >> http://github.com/defunkt.json
/* `Rounded Corners
----------------------------------------------------------------------------------------------------*/
.round_all {
-khtml-border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
}
@thrashr888
thrashr888 / gist:286679
Created January 26, 2010 08:38 — forked from 3n/gist:283188
/* css to make <div id="new">NEW</div> into this: http://bit.ly/5sf4sq */
#new {
display:block;
width:40px;
height:30px;
padding-top:10px;
background-color:#F72F3C;
color:white;
text-align:center;
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.
// =========================
// SetInterval
// =========================
// While not truly accurate, setInterval is still fairly good, time-wise.
// Better for things like a "one second tick" but not great for expensive
// code executed at small intervals as iterations can "stack".
// (ECMAScript 5 strict mode compatible)
/**
* from Secrets of the JavaScript Ninja by John Resig
* Example:
*
* var hello = tmpl("Hello, <%= name %>!");
* alert(hello({name: "world"}));
*/
(function() {
var cache = {};
this.tmpl = function tmpl(str, data) {
@thrashr888
thrashr888 / hack.sh
Created April 1, 2012 02:17 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@thrashr888
thrashr888 / dabblet.css
Created August 1, 2012 22:29 — forked from dstorey/dabblet.css
set the size of the boxes and any decoration
.slider {
/* set initial width */
width: 520px;
/* hide the content that overflows (to allow second box to show through) */
overflow: hidden;
display: inline-block;
/* skew container so that it has angled edge, and set up transition */
transform: skewX(-20deg);
@thrashr888
thrashr888 / flask_geventwebsocket_example.py
Created October 12, 2012 03:48 — forked from lrvick/flask_geventwebsocket_example.py
Simple Websocket echo client/server with Flask and gevent / gevent-websocket
from geventwebsocket.handler import WebSocketHandler
from gevent.pywsgi import WSGIServer
from flask import Flask, request, render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')