-
Install
colordiff
using Homebrew:brew install colordiff
-
Add function to your
~/.bash_profile
:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/sh -x | |
# | |
# Restores a slave node from the specified master and sets up recovery.conf | |
# with streaming replication. | |
# | |
# [email protected] | |
# 2012-01-24 | |
# | |
if [ -z "$1" -o "$1" == "--help" ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Reduces the total number of Squiz CMS backups to the last X days', whilst | |
# also ensuring at least X number of backups always exist. | |
# | |
# In other words, we want only the last X number of days' backups unless the | |
# backups have failed, in which case we'd prefer to keep the old ones until | |
# the backup is running again. | |
# | |
# [email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
/** | |
* Takes specified Markdown files outputs them as HTML. | |
* | |
* Requires showdown: | |
* | |
* npm install showdown | |
* | |
* [email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*~ | |
*.pyc | |
.vagrant | |
venv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Remount a filesystem with new options by unmounting it first (with umount) | |
# and mounting it again. | |
# | |
# Used for filesystems that do not support the -o remount option (eg. NFS). | |
# | |
# Compatible with Linux/bash only. | |
# | |
# 2012-07-17 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set the RGB16bit_list to (choose color) | |
-- convert choosen color to HEX | |
set the formatedColor to my RBG_to_HEX(RGB16bit_list) | |
set the clipboard to formatedColor | |
display dialog "HEX colour value (" & formatedColor & ") has been copied to the clipboard." with icon 1 buttons {"Dismiss"} default button {"Dismiss"} giving up after 10 | |
on RBG_to_HEX(RGB_values) | |
-- this subroutine was taken from "http://www.apple.com/applescript/sbrt/sbrt-04.html" | |
set the hex_list to {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require("md5") | |
local testname = "lua md5 sum hash test (binary)" | |
function test() | |
-- Create object hash | |
local object_key_plain = [[ | |
"0.0.0.0", | |
80, | |
"www.example.com", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
import sys | |
# Crazy URL regexp from Gruber | |
# http://daringfireball.net/2010/07/improved_regex_for_matching_urls | |
r = re.compile(r'(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?]))') | |
# grep -r | |
for parent, dnames, fnames in os.walk(sys.argv[1]): |
Following instructions to set up Wordpress (from http://www.hiphop-php.com/wp/?p=113):
# /usr/bin/hhvm --mode server --user www-data --config /etc/hhvm.hdf
/home/sgolemon/dev/hiphop-php/src/runtime/vm/translator/asm-x64.cpp:79 (makeExecable): mprotect @(nil) 32768 bytes failed (Cannot allocate memory)
/home/sgolemon/dev/hiphop-php/src/runtime/vm/translator/asm-x64.cpp:79 (makeExecable): mprotect @(nil) 32768 bytes failed (Cannot allocate memory)
Aborted (core dumped)