Skip to content

Instantly share code, notes, and snippets.

git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
<?php
// I did this simple hack on a private WordPress Multisite blog, to stop it
// sending me emails every time I created a new blog. It's definitely overkill
// to stop all emails, but unfortunately I couldn't find any hooks that let me
// be more specific! (I didn't need any of the other emails - but you shouldn't
// use this code if you do!)
// I put the code in wp-config.php. You could create a plugin instead, or
// putting it in your theme's functions.php might work (I haven't tested it).
/** @jsx React.DOM */
var STATES = [
'AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI',
'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS',
'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR',
'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY'
]
var Example = React.createClass({
#!/usr/bin/env bash
set -u
set -e
export GIT_WORK_TREE="/var/www/example.com"
export NODE_VERSION="0.10"
echo "--> Checking out..."
git checkout -f
@toddsby
toddsby / patch.txt
Created February 10, 2015 16:02
socket.io and apache reverse proxy fix
I modified the source code of socket.io-client/socket.io.js 1.0.6
line 3387:
return schema + '://' + this.hostname + port + this.path + query;
Changed to:
return schema + '://' + this.hostname + port + this.path + 'ws/' + query;
And my ProxyPass config:
Homebrew server setup
@toddsby
toddsby / forms.twig
Created March 6, 2015 15:10
twig form macros
{% macro input(name, value, type, id, class) %}
<input type="{{ type|default('text') }}" name="{{ name }}" id="{{ id|default(name) }}" value="{{ value|e }}" class="{{ class }}" />
{% endmacro %}
{% macro textarea(name, value, class) %}
<textarea name="{{ name }}" id="{{ id|default(name) }}" class="{{ class }}">{{ value|e }}</textarea>
{% endmacro %}
{% macro label(id, content, class) %}
<label for="{{ id }}" class="{{ class }}">{{ content|e }}</label>
/**
*
* Name v0.0.1
* Description, by Chris Ferdinandi.
* http://gomakethings.com
*
* Free to use under the MIT License.
* http://gomakethings.com/mit/
*
*/
@toddsby
toddsby / github.css
Last active August 29, 2015 14:17 — forked from theconektd/github.css
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
@toddsby
toddsby / kirby.conf
Last active August 29, 2015 14:17 — forked from ramv/kirby.conf
##############################
## Kirby configuration
##############################
location /kirby/ {
include /etc/nginx/mime.types;
index index.php;
root /var/www/addons88/;
if (!-e $request_filename){