Skip to content

Instantly share code, notes, and snippets.

View thurloat's full-sized avatar

Adam Thurlow thurloat

View GitHub Profile
@thurloat
thurloat / css3demo.html
Created July 6, 2010 14:48
A pure CSS3 implementation of the JS + CSS demo: http://tympanus.net/Tutorials/CufonizedFlyOutMenu/
<!-- This is a pure CSS3 implementation of the CSS3 + jQuery Demo for flyout menus I saw today featured on Smashing Mag.
My Demo: http://commondatastorage.googleapis.com/thurloat/css3demo.html
Codes on Gist.Github: http://gist.github.com/465478
Original Link: http://tympanus.net/Tutorials/CufonizedFlyOutMenu/
Original Author: Mary Lou http://tympanus.net/codrops/author/crnacura/
-->
<html>
<head>
class ResponseObject():
html = None
def __init__(self, html):
self.html = html
def render(self):
print "<html>"
print self.html
print "</html>"
def get_user_information():
@thurloat
thurloat / gTrax CSS
Created December 24, 2010 15:25
new stylez for gtrax
div.gwt-TabLayoutPanelTabs {
position: absolute;
left: 0px;
top: -10px;
z-index: 5000;
}
.GONIWUUOH {
background: none;
}
@thurloat
thurloat / format.rb
Created February 3, 2011 01:41
Aptana Javascript Ruble formatter. Replaces the JS Beautifier with Google's fixjsstyle script.
require 'ruble'
command "Reformat Document" do |cmd|
cmd.key_binding = "CTRL+ALT+COMMAND+F"
cmd.output = :replace_selection
cmd.input = :selection, :document
cmd.scope = "source.js"
cmd.invoke do
require 'open3'
require 'beautify2'
@thurloat
thurloat / longer.js
Created February 4, 2011 02:25
2 Options for parsing some JSON data.
/*
* Long and Dreary.
*/
var json = xml2json.parser(response_text),
query_result = json.envelope.body.queryresponse.result,
users = [];
// Build up a list of {{sd.User}}s to return to the view.
if(query_result.size == 1){
@thurloat
thurloat / if_statement.js
Created February 4, 2011 15:10
Is this un-readable?
/**
* OAuth request message skeleton for every request.
* before the final url is generated, it must be run through
* the oauth Timestamp & Signature generators
*
* @constructor
*/
sd.OAuth2.AuthMessage = function(code) {
if (code !== undefined) {
this.parameters = {};
@thurloat
thurloat / minute_rounding.js
Created March 14, 2011 15:35
Round minutes from midnight to the next 5 minute increment.
var right_now = new Date();
var raw_minutes = right_now.getHours() * 60 + right_now.getMinutes();
while (raw_minutes % 5 > 0){
raw_minutes += 1;
}
@thurloat
thurloat / ZenDesk-ControlFreak-tinyMCE-improver.js
Created April 18, 2011 15:57
Control Freak script to replace the default ZenDesk tinyMCE loaded on a page with a more better / full featured one.
/*
* advanced toolbar tinyMCE replacer for ZenDesk.
*/
// remove all existing editors from the page.
var editor_types = ['entry_body', 'post_body'];
for (var i=0; i < editor_types.length; i++) {
if (tinyMCE.editors[editor_types[i]] !== undefined){
tinyMCE.editors[editor_types[i]].remove();
}
@thurloat
thurloat / dictinlist.py
Created April 22, 2011 22:37
find a dict in a list based on the key of one
"""
Find a dict (plan) in a list based on the 'key' key.
"""
ORG_PLANS = [
{
'key': "schoolzone",
'name': 'School Zone',
'seats': 3,
'price': 9
@thurloat
thurloat / views.py
Created April 25, 2011 14:16
Checkout API Thing
"""
My calls into your API.
"""
def finalize_org(request, subscription_id, success_or_fail):
# HURRAH!
def create_org(request, org_type = None):
...