Skip to content

Instantly share code, notes, and snippets.

View mattapperson's full-sized avatar
🏠
Working from home

Matt Apperson mattapperson

🏠
Working from home
View GitHub Profile
find-up() {
local path=$(pwd)
while [[ "$path" != "" && ! -e "$path/$1" ]]; do
path=${path%/*}
done
if [ "$path" != "" ]
then
echo "$path"
fi
}
@mattapperson
mattapperson / app.js
Last active August 29, 2015 13:57 — forked from kwhinnery/app.js
var client = require('twilio')();
// Callback
client.listMessages({
to:'+16516668899'
}, function(err, data, next) {
if (err) {
console.error(err);
} else if (!next()) {
console.log('no more records for query');

Debugging & Profiling Node.js

This is a maintained listing of all the different ways to debug and profile Node.js applications. If there is something missing or an improvement, post a comment! :)

Interactive Stack Traces with traceGL - Shareware

  1. Guide here
@mattapperson
mattapperson / update-vendor-branch.sh
Created June 16, 2012 10:17 — forked from donthorp/update-vendor-branch.sh
Auto-track svn vendor branches in git
#! /bin/sh
# This script expects to be in the parent directory of your github projects
#
# in /etc/cron.hourly create a script that invokes this script for each repo
#
# sudo -u USER /home/USER/PROJECTS-ROOT/update-vendor-branch.sh PROJECT-DIR-1
# sudo -u USER /home/USER/PROJECTS-ROOT/update-vendor-branch.sh PROJECT-DIR-2
echo "Updating vendor repository: $1"
@mattapperson
mattapperson / app.js
Created October 10, 2011 12:10 — forked from dawsontoth/app.js
iOS Text Field Suggestions in Appcelerator Titanium
/**
* This demonstrates how to show suggestions on a text field using just JavaScript with Appcelerator Titanium.
*
* You will need to download four images to get this to work:
*
* 1) http://dl.dropbox.com/u/16441391/Suggest/bg.png
* 2) http://dl.dropbox.com/u/16441391/Suggest/bg@2x.png
* 3) http://dl.dropbox.com/u/16441391/Suggest/separator.png
* 4) http://dl.dropbox.com/u/16441391/Suggest/separator@2x.png
*
@mattapperson
mattapperson / app.js
Created September 7, 2011 15:41 — forked from dawsontoth/app.js
Simple remote on demand image caching.
var iconStore = Ti.Filesystem.applicationDataDirectory + '/CachedRemoteImages';
var dir = Ti.Filesystem.getFile(iconStore);
if (!dir.exists()) {
dir.createDirectory();
}
function cacheRemoteURL(image, imageURL) {
if (imageURL) {
var hashedSource = Ti.Utils.md5HexDigest(imageURL + '') + '.' + imageURL.split('.').pop();
var localIcon = Ti.Filesystem.getFile(iconStore, hashedSource);
if (localIcon.exists()) {
@mattapperson
mattapperson / app.js
Created August 24, 2011 16:42 — forked from appcdr/app.js
Appcelerator: Facebook photo albums sample app
(function() {
Titanium.Facebook.appid = "134793934930";
Titanium.Facebook.permissions = ['publish_stream', 'read_stream', 'user_photos', 'friends_photos'];
Titanium.Facebook.addEventListener('login', function(e) {
if(e.success) {
getAlbumCovers();
return;
} else if(e.error || e.cancelled) {
// Kosso imageAsCropped
// added to TiBlob.m
// requires 4 arguments : x, y, width, height
- (id)imageAsCropped:(id)args
{
[self ensureImageLoaded];
if (image!=nil)
{
ENSURE_ARG_COUNT(args,4);
var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
var html = '<html><body>'
+ '<a href="http://pedro.com">Pedro</a> '
+ '<a href="http://is.com">is</a> '
+ '<a href="http://a.com">a</a> '
+ '<a href="http://balla.com">balla!</a>.'
+ '</body></html>';
var web = Ti.UI.createWebView({