Skip to content

Instantly share code, notes, and snippets.

View jameswburke's full-sized avatar

James Burke jameswburke

View GitHub Profile
<?php
/**
* Wrapper for WP_Query
* Interacts directly with WP_Query_Manager to ensure
* only unique posts are ever returned.
*
* Known issues:
* Won't work with offset values
*/
class Unique_WP_Query extends WP_Query {
@jameswburke
jameswburke / ps-grid-generator.jsx
Created October 10, 2012 23:11
Photoshop Script - Generate Grid Guides
//Modified version of sprite-grid.jsx by Filip Van Tendeloo
//Fixed for earlier versions of Photoshop based on guideLine function from
//http://www.ps-scripts.com/bb/viewtopic.php?f=9&t=3493&start=0
//None of this code is mine
// check for document
if(app.documents.length > 0){
// get active document
var psDoc = app.activeDocument;
@jameswburke
jameswburke / weather.cfm
Created December 26, 2011 22:27
Coldfusion Goolge Weather Caching
<!--- Try to read the file --->
<cftry>
<cffile
action = "read"
file = "C:\weatherCache.txt"
variable = "readWeather" />
<!--- In the event on an error (usually the file is missing) ping google weather and get the data --->
<cfcatch type="Any">
/**
* SocketManager - Singleton to manage multi-channel socket 'routing', need a way to merge with socket.io so client sessions aren't stored twice in memory,
*
* Requires Socket.IO-node and Socket.IO client libraries.
*
* Usage:
* in your main app.js file (or whereever you create the server)
*
* var io = require('socket.io'),
* sm = require('socketmanager');