Skip to content

Instantly share code, notes, and snippets.

View ericdagenais's full-sized avatar

Eric Dagenais ericdagenais

View GitHub Profile
@ericdagenais
ericdagenais / titanium_migrations.js
Created December 5, 2011 00:11 — forked from madmanlear/titanium_migrations.js
Rails-like migrations for Titanium
/*
Model methods below requires Joli.js: https://github.com/xavierlacot/joli.js
Requires a tables named 'migrations' with columns id & version
Database migrations
Each migration is attached to a timestamp
When the migration is run, a record is added to the migrations table so it isn't run again
The rollback function takes a string date and rolls back all migrations since that date and deletes the migration record
Usage:
@ericdagenais
ericdagenais / Rakefile
Last active February 21, 2018 00:36 — forked from oppara/Rakefile
Titanium Mobile Rakefile Build and TestFlight API Script for iOS
DEV_PROVISIONING_UUID = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
DEV_SIGN = 'Your Signing Name'
ADHOC_PROVISIONING_UUID = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
ADHOC_SIGN = 'Your Signing Name'
DEV_APP_DEVICE = 'ipad' # or iphone, universal
IPHONE_SDK_VERSION = '5.0'
@ericdagenais
ericdagenais / backbone.sync.js
Created May 22, 2012 04:19 — forked from rubenfonseca/backbone.sync.js
Backbone + Titanium - part 2
//Customise Backbone.sync to work with Titanium rather than jQuery
var getUrl = function(object) {
if (!(object && object.url)) return null;
return _.isFunction(object.url) ? object.url() : object.url;
};
Backbone.sync = (function() {
var methodMap = {
'create': 'POST',
'read' : 'GET',
@ericdagenais
ericdagenais / Tortoise-Diff-Merge-Settings.md
Created May 24, 2012 18:52
Tortoise Diff/Merge Settings

Perforce

  • Merge

"C:\Program Files\Perforce\P4Merge.exe" %base %theirs %mine %merged

DiffMerge

  • Diff

"C:\Program Files\SourceGear\Common\DiffMerge\sgdm.exe" /t1=Mine /t2=Original %mine %base

@ericdagenais
ericdagenais / uncrush.sh
Created July 6, 2012 06:45
Uncrush PNG Single Line
find . -type d ! -name uncrushed -print | sed 's/\.\///' | xargs -n1 -I '{}' mkdir -p "uncrushed/{}" && find . -name \*.png -print | grep -v './uncrushed/' | sed 's/\.\///' | xargs -n1 -I '{}' /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -q -revert-iphone-optimizations '{}' 'uncrushed/{}'
@ericdagenais
ericdagenais / TiUISmsDialogProxy.h
Created August 6, 2012 18:39 — forked from yellowandy/TiUISmsDialogProxy.h
SMS Dialogue support for TI
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
#ifdef USE_TI_UISMSDIALOG
#import "TiProxy.h"
#import <MessageUI/MessageUI.h>
@ericdagenais
ericdagenais / RecordingVideo.js
Created August 22, 2012 01:25 — forked from dawsontoth/RecordingVideo.js
How to record video, then share or save it. Using Appcelerator Titanium!
/**
* This sample lets you record and share video with Appcelerator Titanium on Android.
* REQUIRES THE 1.6.0 RC OF TITANIUM MOBILE SDK
* http://developer.appcelerator.com/blog/2011/02/release-candidate-for-titanium-mobile-1-6-0.html
*/
/**
* First, create our UI. We'll have two buttons: record, and share.
*/
var win = Titanium.UI.createWindow({
@ericdagenais
ericdagenais / rbenv-install-system-wide.sh
Created November 5, 2012 21:54 — forked from jnx/rbenv-install-system-wide.sh
rbenv install and system wide install on Ubuntu 10.04 LTS.
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
@ericdagenais
ericdagenais / heroku_unicorn_logger_fix.rb
Created November 17, 2012 12:36 — forked from jamiew/heroku_unicorn_logger_fix.rb
Fix Heroku cedar app logging with Rails 3.1 and Unicorn
# config/environments/production.rb
# We're on Heroku, just output straight to STDOUT
# This is required because we're using Unicorn: https://github.com/ryanb/cancan/issues/511#issuecomment-3643266
config.logger = Logger.new(STDOUT)
config.logger.level = Logger.const_get(ENV['LOG_LEVEL'] ? ENV['LOG_LEVEL'].upcase : 'INFO')
@ericdagenais
ericdagenais / App.config
Created February 10, 2013 14:18
Sample GelfUdpAppender and RemoteSyslogAppender configuration
<appender name="GelfUdpAppender" type="Gelf4net.Appender.GelfUdpAppender, Gelf4net">
<remoteAddress value="graylog2.address"/>
<remotePort value="12201"/>
<layout type="Gelf4net.Layout.GelfLayout, Gelf4net">
<param name="AdditionalFields" value="app:AppName,version:trunk,Level:%level,Logger:%logger,Thread:%thread,Exception:%exception" />
<param name="Facility" value="AppName"/>
<param name="IncludeLocationInformation" value="true"/>
</layout>
</appender>