Skip to content

Instantly share code, notes, and snippets.

View paulredmond's full-sized avatar
🏴‍☠️

Paul Redmond paulredmond

🏴‍☠️
View GitHub Profile
@paulredmond
paulredmond / timeout.php
Created July 11, 2012 21:41 — forked from avalanche123/timeout.php
timeouts in php
<?php
class TimeoutException extends RuntimeException {}
class Timeout
{
private $active;
public function set($seconds)
{
YUI.add('node-scroll-info', function (Y) {
/**
Provides the ScrollInfo Node plugin, which exposes convenient events and methods
related to scrolling.
@module node-scroll-info
**/
/**
@paulredmond
paulredmond / function.timeago.php
Created May 1, 2012 18:15
Smarty time ago function
<?php
function smarty_function_timeago( $params, &$smarty )
{
$conversions = array(
'millisecond' => 1,
'second' => 1000,
'minute' => 60,
'hour' => 60,
'day' => 24,
@paulredmond
paulredmond / spam_detection.xml
Created April 4, 2012 17:25
spam_detection.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!--
This file is part of the FOSCommentBundle package.
(c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
This source file is subject to the MIT license that is bundled
with this source code in the file LICENSE.
-->
@paulredmond
paulredmond / pngout.rb
Created February 10, 2012 17:29
pngout homebrew formula
require 'formula'
class Pngout < Formula
url 'http://static.jonof.id.au/dl/kenutils/pngout-20110722-darwin.tar.gz'
homepage 'http://www.jonof.id.au/kenutils'
md5 'ce70a9d70e08b1920e5ac88d130d0eb9'
version '20110722'
def install
prefix.install Dir['*']
@paulredmond
paulredmond / .tm_properties
Created January 3, 2012 22:47
My .tm_properties file
TM_GIT = "/usr/local/bin/git"
windowTitle = '$TM_FILEPATH'
fontName = "Anonymous Pro"
fontSize = 14
# Extra files to include
myExtraIncludes = ".tm_properties,.htaccess,.gitignore"
fileBrowserGlob = "{*,$myExtraIncludes}"
@paulredmond
paulredmond / parse_articles.js
Created November 17, 2011 00:40 — forked from benscholler/parse_articles.js
Wordpress Exporter via Node
// General exporter of WP exports into JSON objects. From that, we can build models to save to the DB.
// In usage at shell...
// cat file_of_wp_export.xml | node parse_articles.js >> json_output_file.json
/* Module Includes */
var xml2js = require('xml2js'), // Parser that reads in XML and converts it to JSON
YUI = require('yui3').YUI, // The YUI library
_ = require('underscore'); // Utility belt of JS functions
var data = '', file = '', arg = '';
@paulredmond
paulredmond / deploy.rb
Created September 17, 2011 21:49 — forked from josegonzalez/deploy.rb
Capistrano Deploy Script for CakePHP applications using GIT (Update the $config hash))
$config = {
"application" => "DOMAIN.TLD",
"repository" => "git@GITHOST:USERNAME/REPOSITORYNAME.git",
"remoteusername" => "REMOTEUSERNAME",
"cake_folder" => "/PATH/TO/CAKE",
"cake_version" => "cakephp1.3",
"plugin_dir" => "plugins",
"servers" => {
"prod" => {
"server" => "APPLICATION.TLD",
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.
@paulredmond
paulredmond / Custom.css
Created August 17, 2011 17:11
Espresso syntax theme for Google Chrome Inspector
/**********************************************/
/*
/* Espresso-inspired theme for Google Chrome Inspector
/*
/* By: Paul Redmond http://github.com/paulredmond
/*
/* Inspired by Darcy Clarke's post - http://darcyclarke.me/design/skin-your-chrome-inspector/
/* Darcy Clarke's "Darker Skin" theme - http://darcyclarke.me/dev/inspectorskin/Custom.css
/*
/**********************************************/