Skip to content

Instantly share code, notes, and snippets.

@peterkappus
peterkappus / haml-sass builder
Created August 24, 2011 23:33
Haml/Sass builder script (great for Wordpress themes & other HTML-like templates)
require 'digest/md5'
=begin
About:
This script automatically runs on a 2-second loop, searches the current directory for haml & sass files that have been modified since the last iteration and builds them as needed into a file with the same name minus the .haml/sass extension. I wrote it so I could use Haml & Sass to develop Wordpress themes.
How-to:
1) Name your source files with the extension you'd like them to have, then add ".haml" or ".sass" as appropriate...
For example: index.php.haml and styles.css.sass
# $Id: PKGBUILD 134523 2011-08-05 07:55:30Z juergen $
# Maintainer: Juergen Hoetzel <[email protected]>
# Contributor: Renchi Raju <[email protected]>
pkgname=emacs-athena
pkgver=23.3a
pkgrel=1
pkgdesc="The Emacs Editor, with Athena widget toolkit"
arch=(i686 x86_64)
url="http://www.gnu.org/software/emacs/emacs.html"
license=('GPL')
@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)
@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/
*/
@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
@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;
:+1:
:-1:
:airplane:
:art:
:bear:
:beer:
:bike:
:bomb:
:book:
:bulb:
@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
*/
@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
*/
@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)