Skip to content

Instantly share code, notes, and snippets.

View attilagyorffy's full-sized avatar
🦜
A UDP packet bar walks a into...

Attila Györffy attilagyorffy

🦜
A UDP packet bar walks a into...
View GitHub Profile
@attilagyorffy
attilagyorffy / gist:1351966
Created November 9, 2011 16:24 — forked from attaboy/gist:1346280
Destroy the localStorage copy of less.js client-side-generated CSS
// Destroys the localStorage copy of CSS that less.js creates
function destroyLessCache(pathToCss) { // e.g. '/css/' or '/stylesheets/'
if (!window.localStorage || !less || less.env !== 'development') {
return;
}
var host = window.location.host;
var protocol = window.location.protocol;
var keyPrefix = protocol + '//' + host + pathToCss;
@attilagyorffy
attilagyorffy / jquery.support.cssproperty.js
Created July 28, 2011 14:06 — forked from jackfuchs/jquery.support.cssproperty.js
Extends the jQuery.support object to CSS Properties
/**
* jQuery.support.cssProperty
* To verify that a CSS property is supported (or any of its browser-specific implementations)
*
* @param string p - css property name
* [@param] bool rp - optional, if set to true, the css property name will be returned, instead of a boolean support indicator
*
* @Author: Axel Jack Fuchs (Cologne, Germany)
* @Date: 08-29-2010 18:43
*
@attilagyorffy
attilagyorffy / ba-ghettotmpl.js
Created June 11, 2011 18:45 — forked from cowboy/ba-ghettotmpl.js
Ghetto fabulous templating system. More ghetto than fabulous.
// Ghetto fabulous template system for replacing values in strings. If {{.foo}}
// or {{.bar[0].baz}} is encountered (leading . or ( or [ char), attempt to
// access properties of data object like `data.foo` or `data.bar[0].baz`.
// Alternately, if {{foo}} or {{bar("baz")}} is encountered (no leading dot),
// simply evaluate `foo` or `bar("baz")`. If an error occurs, return empty
// string. Oh yeah, you have to pass the result of ghettoTmpl to eval. :)
function ghettoTmpl(data, str) {
ghettoTmpl._data = data;
ghettoTmpl._str = str;
/* Ismael Celis 2010
Simplified WebSocket events dispatcher (no channels, no users)
var socket = new ServerEventsDispatcher();
// bind to server events
socket.bind('some_event', function(data){
alert(data.name + ' says: ' + data.message)
});
# Free RESTful interface for your Ruby objects with Rackable
# http://github.com/madx/rackable/tree/master
#
# + Free HTTP caching with rack-cache
# http://github.com/rtomayko/rack-cache/tree/master
require 'rackable'
require 'rack/cache'
APP_ROOT = File.dirname(__FILE__)