Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View joshualambert's full-sized avatar
🎧

Josh Lambert joshualambert

🎧
View GitHub Profile
@joshualambert
joshualambert / datepicker.js
Created July 3, 2012 21:00 — forked from bilalq/datepicker.js
Date Picker in Titanium
var dateOfBirth = Ti.UI.createPicker({
type: Ti.UI.PICKER_TYPE_DATE,
minDate:new Date(1900,1,1),
maxDate:new Date(2000,1,1),
value:new Date(1995,8,1)
});
var birthDayLine = Ti.UI.createView({
layout: 'horizontal',
height: Ti.UI.SIZE,
@joshualambert
joshualambert / install-git-ftp
Created September 14, 2012 17:45
How to install git-ftp
(Copied From: http://alexfluger.blogspot.com/2012/01/easy-deploy-to-ftp-from-git.html) (Thank you Alex, this has helped me alot!)
Easy deploy to FTP from GIT
Have a shared hosting? No SSH and Git? Take a look on git-ftp. It is very easy to install and use. Here I will show you how to install it and start to use.
Installation
First, clone source code repository from github (it will create git-ftp folder):
var isAndroid = false;
if(Titanium.Platform.name == 'android') {
isAndroid = true;
}
Ti.Geolocation.preferredProvider = Ti.Geolocation.PROVIDER_GPS;
Ti.Geolocation.accuracy = Ti.Geolocation.ACCURACY_BEST;
Ti.Geolocation.distanceFilter = 0;
Ti.Geolocation.purpose = "Save your last known position.";
@joshualambert
joshualambert / hold.js
Created October 15, 2012 16:39
Used to delete a row.
var row = Titanium.UI.createTableViewRow({
height:'50dp',
width:'100%',
layout:'absolute'
});
var rowView = Ti.UI.createView({
left:'0dp',
top:'0dp',
width:'230dp',
function initialize() {
var mapOptions = {
center: new google.maps.LatLng(33.219105,-87.046053),
zoom: 16,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
@joshualambert
joshualambert / gist:4073548
Created November 14, 2012 17:34 — forked from RaVbaker/gist:2967695
[HOWTO] Ubuntu 12.04 Ruby on Rails Development Environment

Ubuntu 12.04 Ruby on Rails Development Environment

I haven't set up an install guide for the latest ubuntu release, largely because the last set of instructions worked pretty closely with the latest and greatest Ubuntu, 12.04 Precise Pangolin, however when installing today, I found that there were enough differences in the way that I configure my setup to justify an update, so here it goes. Yes, I'm late to the party, but a quick google search didn't find anything that I felt was as complete for my requirements as my previous install guides, so here I go.

As always with my install guides, I have included here is just about everything you'll need (and then some) to get started with ruby on rails development with Ubuntu 12.04 as a platform. These are my settings and preferences, and this is certainly not the only way of doing things, so keep that in mind.

Step 1: Get the repos ready and run updates.

sudo apt-get update && sudo apt-get upgrade
@joshualambert
joshualambert / gist:4128161
Created November 21, 2012 22:03
Switch loop
followMeSwtichCheckbox.eventOverride = false;
followMeSwtichCheckbox.addEventListener('change', function(e) {
if (followMeSwtichCheckbox.eventOverride == false) {
if (checkSOSactive() == false) {
alert('SOS inactive.');
} else {
followMeSwtichCheckbox.eventOverride = true;
if (followMeSwtichCheckbox.value == true) {
followMeSwtichCheckbox.value = false;
@joshualambert
joshualambert / gist:4270844
Created December 12, 2012 19:35
Ti.storekit Verification Issue
[INFO] One moment, building ...
[INFO] Detected third-party module: ti.storekit/1.6.1
[INFO] Detected third-party module: ti.storekit/1.6.1
[INFO] Titanium SDK version: 2.1.3 (10/02/12 16:16 15997d0)
[INFO] iPhone Device family: iphone
[INFO] iPhone SDK version: 5.0
[INFO] iPhone simulated device: iphone
[INFO] Performing full rebuild. This will take a little bit. Hold tight...
[INFO] Minimum iOS version: 4.0 Linked iOS Version 5.0
[INFO] Performing clean build
@joshualambert
joshualambert / gist:4273022
Created December 13, 2012 00:32
Storekit Purchase Issue
--------------------------------------------------
Code
--------------------------------------------------
AppContext.Storekit.requestProducts(['com.testproduct.lite.pm1'], function (evt) {
displayLog(JSON.stringify(evt));
if (!evt.success) {
alert('ERROR: We failed to talk to Apple!');
}
else if (evt.invalid) {
@joshualambert
joshualambert / gist:4347159
Created December 20, 2012 17:47
time_since() - Time comparison function for PHP.
/*
* Originally written by: billythekid.
* https://twitter.com/billythekid
*
* Modified by: Joshua Lambert.
* https://twitter.com/zettageek
*
* Changelog:
* - Added array output.
* - Added ability to pass in custom end timestamp.