Skip to content

Instantly share code, notes, and snippets.

@bigdawggi
bigdawggi / README.txt
Created October 24, 2011 19:31 — forked from alexkingorg/wp-switch-to-post.php
switch_to_post() stack implementation (similar to switch_to_blog()) for WordPress
# Switch to Post README
## Overview
switch_to_post() stack implementation (similar to switch_to_blog()) for WordPress
## Questions
1. Do we want to still switch to post if the get_post fails?
2. Have a (bool) return value based on get_post?
## Test Steps
@litchfield
litchfield / doubledecode.py
Created October 12, 2011 21:53
Double decode utf8 and cp1252
#!/usr/bin/env python
"""
Ever had a mysqldump of utf8 data stored in latin1 tables, dumped in utf8 and
munged with windows cp1252?
If so this is your friend. Just pipe it through this little baby and spare
yourself hours of unicode hell- it'll take your dirt and spit out clean utf8.
You can also import it and use it in your python code.
@mjangda
mjangda / wpcom-open-graph.php
Created September 5, 2011 22:30
Add Open Graph tags to your WordPress site
<?php
/**
* Open Graph Tags
*
* Add Open Graph tags so that Facebook (and any other service that supports them)
* can crawl the site better and we provide a better sharing experience.
*
* @link http://ogp.me/
* @link http://developers.facebook.com/docs/opengraph/
*/
@mrdoob
mrdoob / RequestAnimationFrame.js
Created February 22, 2011 14:50
Provides requestAnimationFrame in a cross browser way.
/**
* Provides requestAnimationFrame in a cross browser way.
* @author paulirish / http://paulirish.com/
*/
if ( !window.requestAnimationFrame ) {
window.requestAnimationFrame = ( function() {
return window.webkitRequestAnimationFrame ||