Skip to content

Instantly share code, notes, and snippets.

@sosukeinu
sosukeinu / backup.sh
Created January 25, 2013 20:11
BASH backup script
#!/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
@sosukeinu
sosukeinu / rss-subscribers.sh
Created January 25, 2013 20:11 — forked from btobolaski/rss-subscribers.sh
BASH cron job to list RSS subscribers
#!/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.
@sosukeinu
sosukeinu / Sublime-Text2-useful-shortcuts.md
Last active December 11, 2015 17:49 — forked from mingliangguo/gist:3291698
CONFIG Sublime Text 2 useful shortcuts

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 |

@sosukeinu
sosukeinu / Preferences.sublime-settings
Created January 25, 2013 20:11 — forked from fpinzn/Preferences.sublime-settings
CONFIG Sublime Text 2 settings
// 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
@sosukeinu
sosukeinu / wp_tax_bread_functions.php
Last active December 11, 2015 17:49 — forked from billerickson/gist:1325540
WP function taxonomy breadcrumbs
<?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

Tweet this - Follow me

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

@sosukeinu
sosukeinu / ela.py
Last active August 29, 2015 14:08 — forked from ewencp/ela.py
#!/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