Skip to content

Instantly share code, notes, and snippets.

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

Paul Redmond paulredmond

🏴‍☠️
View GitHub Profile
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 / 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 / remote-tail.js
Created May 18, 2011 23:15 — forked from justinrainbow/remote-tail.js
Tail a remote file on multiple servers with Node.js
var sys = require('sys'),
spawn = require('child_process').spawn,
// args from command line
filename, servers;
if (process.ARGV.length < 4) {
return sys.puts("Usage: node remote-tail.js filename server1 [serverN]");
}
<?php
$dir = new RecursiveDirectoryIterator(dirname(__FILE__));
$iterator = new RecursiveIteratorIterator($dir);
$pattern = '~\{(.+?)\}~im';
$start_char = '{';
$end_char = '}';
require 'formula'
def mysql_installed?
`which mysql_config`.length > 0
end
class Php <Formula
url 'http://www.php.net/get/php-5.3.3.tar.gz/from/this/mirror'
homepage 'http://php.net/'
md5 '5adf1a537895c2ec933fddd48e78d8a2'
require 'formula'
def mysql_installed?
`which mysql_config`.length > 0
end
class Php <Formula
url 'http://www.php.net/get/php-5.3.3.tar.gz/from/this/mirror'
homepage 'http://php.net/'
md5 '5adf1a537895c2ec933fddd48e78d8a2'
# --------------------------------------------
# General
# --------------------------------------------
set :shared_children, %w(cache logs) # Shared directories, these directories contain generated content which should not be wiped out during deployments.
set :application, "domain.com" # Application name
set :deploy_to, "/var/www/#{application}/#{stage}" # Path where files are deployed to ...
# --------------------------------------------
# Server
# --------------------------------------------