Skip to content

Instantly share code, notes, and snippets.

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

Paul Redmond paulredmond

🏴‍☠️
View GitHub Profile
<!doctype html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js ie6" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
<?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 / 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",
@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 / .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 / 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.
-->
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 / 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)
{
@paulredmond
paulredmond / gist:3130269
Created July 17, 2012 15:58 — forked from w33ble/gist:3124943
bashrc with git ps1
WHITE="\[\033[00m\]"
BLACK="\[\033[01;30m\]"
RED="\[\033[0;31m\]"
LIGHT_RED="\[\033[1;31m\]"
GREEN="\[\033[0;32m\]"
LIGHT_GREEN="\[\033[1;32m\]"
YELLOW="\[\033[0;33m\]"
BLUE="\[\033[0;34m\]"
PURPLE="\[\033[0;35m\]"
CYAN="\[\033[0;36m\]"
@paulredmond
paulredmond / gist:3161957
Created July 23, 2012 04:21 — forked from madrobby/gist:3161015
detect retina support
function isRetina(){
return (('devicePixelRatio' in window && devicePixelRatio > 1) ||
('matchMedia' in window && matchMedia("(-moz-device-pixel-ratio:1.0)").matches))
}