Skip to content

Instantly share code, notes, and snippets.

@EinLama
EinLama / magicWarden.rb
Created April 21, 2011 13:54
Small helper script. Watches a folder and magically compiles HAML and Coffeescript-code :)
# magicWarden.rb - 2011 (c) Tobias Eilert
#
# Watches a folder recursively for changes and takes certain actions when files
# are changed. You can specify the directory you want to watch on startup.
# If no directory is passed, the magical warden will take care of the current place.
#
# $ magicWarden.rb some/path/to/some/place
# $ magicWarden.rb # same as magicWarden.rb .
#
# Runs on Mac OS X, Windows and GNU/Linux with Ruby >= 1.9.2
@nathansmith
nathansmith / last_child.js
Created May 1, 2011 19:26
Force IE7 & IE8 to respect :last-child
// Heavy-handed way to force IE7 & IE8 to respect :last-child.
// Note: Using jQuery. Adjust to suit your library, etc.
//
// Style via...
//
// element:last-child,
// element.last-child {
// /* Style here */
// }
//
@abhiyerra
abhiyerra / .mew.el
Created May 2, 2011 02:41
mew.el file.
(add-to-list 'load-path "~/Dropbox/Mew")
(autoload 'mew "mew" nil t)
(autoload 'mew-send "mew" nil t)
;; Optional setup (Read Mail menu for Emacs 21):
(if (boundp 'read-mail-command)
(setq read-mail-command 'mew))
;; Optional setup (e.g. C-xm for sending a message):
(autoload 'mew-user-agent-compose "mew" nil t)
(if (boundp 'mail-user-agent)
@bueltge
bueltge / commentmeta-single.php
Created May 3, 2011 11:35
WordPress Example Plugin: Comment meta data test
<?php
/*
Plugin Name: Comment meta data test
Version: 1.0
Plugin URI: http://wpengineer.com
Description: Comment meta data test
Author: Latz
Author URI: http://wpengineer.com
*/
@bueltge
bueltge / commentmeta-multi.php
Created May 3, 2011 11:38
WordPress Example Plugin: Comment meta data test
<?php
/*
Plugin Name: Comment meta data test
Version: 1.0
Plugin URI: http://wpengineer.com
Description: Comment meta data test
Author: Latz
Author URI: http://wpengineer.com
*/
:+1:
:-1:
:airplane:
:art:
:bear:
:beer:
:bike:
:bomb:
:book:
:bulb:
@idan
idan / _more.scss
Created June 6, 2011 08:40
More is Less
$less-column-width: 68px;
$less-gutter-width: 24px;
@function column-width($columns) {
@return ($less-column-width * $columns) + ($less-gutter-width * ($columns - 1));
}
@function grid-padding-px($columns) {
@if $columns == 10 {
@return 48px;
@timmyomahony
timmyomahony / twittify.py
Created June 13, 2011 16:42
twittify: django template filter to replace metions (@'s) and hashtags (#'s) with links to twitter
@register.filter(name='twittify')
def twittify(value):
""" Replace @ and #'s with links to twitter"""
return mark_safe(
re.sub(r"#(?P<ht>([a-zA-Z0-9_])+)", r"#<a href='http://twitter.com/#!/search?q=\g<ht>' target='_blank'>\g<ht></a>",
re.sub(r"@(?P<un>([a-zA-Z0-9_]){1,15})", r"@<a href='http://twitter.com/\g<un>' target='_blank'>\g<un></a>", value))
)
twittify.mark_safe=True
@markjaquith
markjaquith / disable-plugins-when-doing-local-dev.php
Created June 24, 2011 10:24
Disables specified WordPress plugins when doing local development
<?php
/*
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
@joshfinnie
joshfinnie / gist:1102695
Created July 24, 2011 14:51
Flask Signup/Login Template
from datetime import datetime
from flask import *
from flaskext.wtf import *
from flaskext.sqlalchemy import *
from werkzeug import generate_password_hash, check_password_hash
app = Flask()
app.config.from_pyfile('app_settings.py')
db = SQLAlchemy(app)