h1. Sublime Text 2 - Useful Shortcuts (Mac OS X)
h2. General
| ⌘T | go to file | | ⌘⌃P | go to project | | ⌘R | go to methods | | ⌃G | go to line | | ⌘KB | toggle side bar | | ⌘⇧P | command prompt |
#!/bin/bash | |
year="$1" | |
month="$2" | |
day="$3" | |
server_name='interactivedept' | |
backup_repository() { | |
repo_name="$1" | |
svnadmin hotcopy /home/repo/$repo_name /home/backup/$repo_name-repo |
#!/bin/bash | |
# A modification of Marco Arment's script at | |
# | |
# https://gist.github.com/3783146 | |
# | |
# It's intended to be run once a day as a cron job. The main | |
# differences between it and Marco's script are: | |
# | |
# 1. It checks two feeds instead of just one. |
h1. Sublime Text 2 - Useful Shortcuts (Mac OS X)
h2. General
| ⌘T | go to file | | ⌘⌃P | go to project | | ⌘R | go to methods | | ⌃G | go to line | | ⌘KB | toggle side bar | | ⌘⇧P | command prompt |
// While you can edit this file, it's best to put your changes in | |
// "User/Preferences.sublime-settings", which overrides the settings in here. | |
// | |
// Settings may also be placed in file type specific options files, for | |
// example, in Packages/Python/Python.sublime-settings for python files. | |
{ | |
// Sets the colors used within the text area | |
"color_scheme": "Packages/RailsCasts Colour Scheme/RailsCastsColorScheme.tmTheme", | |
// Note that the font_face and font_size are overriden in the platform |
<?php | |
/* Taxonomy Breadcrumb */ | |
function be_taxonomy_breadcrumb() { | |
// Get the current term | |
$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); | |
// Create a list of all the term's parents | |
$parent = $term->parent; | |
while ($parent): | |
$parents[] = $parent; |
<?php | |
/** | |
* An example function used to demonstrate how to use the `user_can_save` function | |
* that provides boilerplate security checks when saving custom post meta data. | |
* | |
* The ultimate goal is provide a simple helper function to be used in themes and | |
* plugins without the need to use a set of complex conditionals and constants. | |
* | |
* Instead, the aim is to have a simplified function that's easy to read and that uses | |
* WordPress APIs. |
<?php | |
/** | |
* This little class records how long it takes each WordPress action or filter | |
* takes to execute which gives a good indicator of what hooks are being slow. | |
* You can then debug those hooks to see what hooked functions are causing problems. | |
* | |
* This class does NOT time the core WordPress code that is being run between hooks. | |
* You could use similar code to this that doesn't have an end processor to do that. | |
* |
#How I built an audio book reader for my nearly blind grandfather
Last year, when visiting my family back home in Holland, I also stopped by my grand-parents. My grand-father, now 93 years old, had always been a very active man. However, during the presceding couple of months, he'd gone almost completely blind and now spent his days sitting in a chair. Trying to think of something for him to do, I suggested he try out audio books. After finally convincing him -- he said audio books were for sad old people -- that listening to a well performed recording is actually a wonderful experience, I realized the problem of this idea.
####The problem with audio devices and the newly blind. After my first impulse to jump up and go buy him an iPod Touch, I soon realized that, to use an iPod, or any audio d
#!/usr/bin/env python | |
# This is a really simple implementation of ELA as described in | |
# http://blackhat.com/presentations/bh-dc-08/Krawetz/Whitepaper/bh-dc-08-krawetz-WP.pdf | |
# You shouldn't actually use it, or at least read the paper carefully | |
# and implement more of the techniques before drawing any conclusions. | |
from PIL import Image, ImageChops, ImageEnhance | |
import sys, os.path |
1) Install MAMP normally | |
2) Download the latest binary of tomcat from http://tomcat.apache.org/ and extract it into the MAMP folder | |
(you should now have a /Applications/MAMP/apache-tomcat-version folder) | |
3) Create a link to the apache-tomcat folder: | |
ln -s /Applications/apache-tomcat-7.0.37/ tomcat | |
4) Make sure all the binaries are executable: | |
cd /Applications/tomcat/bin |