This file contains 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
/* | |
* File: tones.h | |
* Author: [email protected] | |
* | |
* Created on 13 December 2012, 9:01 AM | |
* | |
* Audio tone frequencies expressed as Hz | |
* | |
*/ |
This file contains 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 | |
find . -iname '*.js'|grep -v -E "^./(dev|node_modules|components|(public/js/((angular|bootstrap|jquery|underscore|modernizr|tiny_mce))))"|xargs wc -l|less |
This file contains 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
SELECT table_schema "DB Name", | |
Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" | |
FROM information_schema.tables | |
GROUP BY table_schema; |
This file contains 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
app.config(function($httpProvider) { | |
$httpProvider.interceptors.push(function($rootScope, $location, $q) { | |
return { | |
'request': function(request) { | |
// if we're not logged-in to the AngularJS app, redirect to login page | |
$rootScope.loggedIn = $rootScope.loggedIn || $rootScope.username; | |
if (!$rootScope.loggedIn && $location.path() != '/login') { | |
$location.path('/login'); | |
} | |
return request; |
This file contains 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
# This works for my model anyway, use | |
echo 0x069b >> ~/.android/adb_usb.ini | |
adb kill-server | |
adb devices |
This file contains 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 | |
# | |
# 1. Put this somewhere like /usr/local/bin/fakemail.sh | |
# 2. Set the permissions with: chmod a+x /usr/local/bin/fakemail.sh | |
# 3. Edit your php.ini and set: sendmail_path=/usr/local/bin/fakemail.sh | |
# | |
# Now your email will not be sent but logged to unique files that are timestamped. | |
# We use $RANDOM just to try and reduce collissions in case multiple emails are sent at the same time. | |
# |
This file contains 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
/* | |
This file is used to test any input that is also used as an output to ensure sanitisation has occured: | |
Usage: on any form input enter something like: | |
<script src="thisfile.js"></script> | |
*/ | |
alert('If this alert box worked then you need to sanitise your output!'); |
This file contains 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 | |
# | |
# We use this code from cron to automate nightly volume snapshots. | |
# In our case we have two volumes. | |
# | |
# | |
export EC2_KEYPAIR=MY-KEY-PAIR | |
export EC2_URL=https://ec2.ap-southeast-2.amazonaws.com | |
export AWS_ACCESS_KEY=accesskey | |
export AWS_SECRET_KEY=secretkey |
This file contains 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
# apache-config-watch - checks config changes and reloads apache if the configs are ok | |
description "Reload apache when configs have changed." | |
author "Michael McHugh <[email protected]>" | |
start on runlevel [2345] | |
stop on runlevel [016] | |
respawn |
This file contains 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/local/bin/node | |
//quick and dirty to get my scripts going quickly on awsbox from cron. Will clean this up some other time. | |
var path = require('path'); | |
var child_process = require('child_process'); | |
var configFile = path.join(process.env['HOME'], 'config.json'); | |
var config = require(configFile); |