Skip to content

Instantly share code, notes, and snippets.

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

Paul Redmond paulredmond

🏴‍☠️
View GitHub Profile
@paulredmond
paulredmond / git-hg-rosetta-stone.md
Last active August 29, 2015 14:06
Git / Mercurial Rosetta Stone

Note: this is from the sympy/sympy wiki

The sympy git server is at https://github.com/sympy/sympy . The main Sympy repository may be cloned with "git clone git://github.com/sympy/sympy.git".

The first and the most important thing is that you should understand that git is '''different'''. For example it uses staging area (so called index) for iteratively preparing commits. This and other great and unique features of git make it the preference of many developers, so go read its documentation - you would not regret!

#!/usr/bin/env ruby
require 'rubygems'
require 'Sprockets'
require 'Jsmin'
MINFILE = 'app/webroot/js/build-min.js'
CONCATFILE = 'app/webroot/js/concat.js'
secretary = Sprockets::Secretary.new(
:asset_root => 'app/webroot',
@paulredmond
paulredmond / remove-containers-before.sh
Created September 12, 2015 05:45
Remove all Docker containers with --before flag
docker rm $(docker ps -a --before 97b0b463468f | awk '{if (NR!=1) {print $1}}')
<?php
/**
* PluginRoute class.
*
* Route class for plugins that allows you to clean up urls for plugins
* without tons of calls to Router::connect() to shorten controller names in urls.
*/
class PluginRoute extends CakeRoute
{
# --------------------------------------------
# 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
# --------------------------------------------
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'
# Run from the terminal to generate phpdocumentor files
phpdoc -d ~/path/to/app -t ~/path/to/place/docs -ti 'Documentation Title' -dn 'defaultpackage'
<!-- broken -->
<a href="#" class="connect-login">
<img src="http://media.sheknows.com/dares/ui/connect_sign_in.png" alt="Sheknows Connect">
</a>
<!-- :) -->
<a href="#" class="connect-login" data-redirect="/dares">
<img src="http://media.sheknows.com/dares/ui/connect_sign_in.png" alt="Sheknows Connect">
</a>
<?php
$dir = new RecursiveDirectoryIterator(dirname(__FILE__));
$iterator = new RecursiveIteratorIterator($dir);
$pattern = '~\{(.+?)\}~im';
$start_char = '{';
$end_char = '}';