Skip to content

Instantly share code, notes, and snippets.

View windhamdavid's full-sized avatar
🦮
garbage in garbage out

David Windham windhamdavid

🦮
garbage in garbage out
View GitHub Profile
require 'rubygems'
require 'sinatra'
require 'redis'
# To use, simply start your Redis server and boot this
# example app with:
# ruby example_note_keeping_app.rb
#
# Point your browser to http://localhost:4567 and enjoy!
#
@defunkt
defunkt / installing-Mustache.tmbundle.md
Created March 6, 2010 10:27
Installing Mustache.tmbundle
@eculver
eculver / filter microsoft word special characters
Created April 18, 2010 04:30
convert microsoft word special characters to html entities
import re
def convert_1252_codes(text):
"""Convert windows-1252 characters to appropriate html entities.
@param str String to filter
@type string/unicode
@return unicode version of filtered string
Adapted from: http://effbot.org/zone/unicode-gremlins.htm
<?php
/*
Description: Adds a taxonomy filter in the admin list page for a custom post type.
Written for: http://wordpress.stackexchange.com/posts/582/
By: Mike Schinkel - http://mikeschinkel.com/custom-workpress-plugins
Instructions: Put this code in your theme's functions.php file or inside your own plugin. Edit to suite your post types and taxonomies. Hope this helps...
*/
add_filter('manage_listing_posts_columns', 'add_businesses_column_to_listing_list');
function add_businesses_column_to_listing_list( $posts_columns ) {
if (!isset($posts_columns['author'])) {
@Servana
Servana / gist:663986
Created November 5, 2010 11:08
Install mod_pagespeed on Ubuntu with Skystack
#!/bin/bash
arch=$(uname -m)
if [ $arch = 'x86_64' ]; then
SOURCE=https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_amd64.deb
NAME=mod-pagespeed-beta_current_amd64.deb
else if [ $arch = 'i686' ]; then
@kinlane
kinlane / Convert Word and Powerpoint File to PDF with Google Docs API
Created April 16, 2011 03:48
This will convert Microsoft Word and Powerpoint files to PDF using the Google Docs Listing API.
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
@fukata
fukata / app.coffee
Created April 21, 2011 07:50
Rewrite app.js of Expressjs to CoffeeScript.
###
Module dependencies.
###
express = require 'express'
app = module.exports = express.createServer()
###
Configuration
@chrismatthieu
chrismatthieu / gist:992261
Created May 25, 2011 23:57
If you ever need to remove files from your GitHub repo's history, here's how to do it:
1. add all of the files you want to hide to .gitignore
2. git commit -a -m "removed files"
3. git filter-branch
4. git push origin master -f
@madrobby
madrobby / i18n.coffee
Created November 14, 2011 15:45
Backbone i18n with CoffeeScript
# before this file is loaded, a locale should be set:
#
# In a browser environment, you can use:
# ```<script>__locale='en';</script>```
#
# In a server environment (specifically node.js):
# ```global.__locale = 'en';```
# normalize in-app locale string to "en" or "de-AT"
parts = @__locale.split('-')
@boucher
boucher / StripeTutorialPage.html
Created February 6, 2012 07:05
Stripe Tutorial Payment Form
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
// this identifies your website in the createToken call below