Skip to content

Instantly share code, notes, and snippets.


Josh Lambert joshualambert

View GitHub Profile
View gist:ba5d6bbe98bc9b8124e8a04648df9d20
// Used to prompt a user for how to open an address, or open automatically, based on the platform.
function openAddress(destAddr, startAddr) {
var destParam = '';
var startParam = '';
if (typeof destAddr !== 'undefined') {
destParam = '&daddr=' + encodeURIComponent(destAddr);
if (typeof startAddr !== 'undefined') {
startParam = '&saddr=' + encodeURIComponent(startAddr);
joshualambert / bitly.js
Last active Sep 29, 2017
Titanium BitLy CommonJS Library
View bitly.js
* Used to interact with the Bit.LY API.
* Written by: Josh Lambert
* Twitter: @zettageek
* Email:
* Version: 1.0
var apiKey,
apiVersion = 'v3',
View gist:05df65992ff884e81e04
Verifying I am +joshlambert on my passcard.
View gist:c8171ab4afdbc7f2a768
View .htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-z]+)/([^/]*)$ resize.php?size=$1&file=$2
View gist:ced68ec5a6f2825611c6
There are two types of LOVs:
1) Static - A set list of options in APEX.
- Static = Entries are automatically alphabetized
- Static2 = Entries are displayed in the order that they’re entered.
2) Dynamic - Based on SQL against the database.
LOVs can be defined as either:
a) A shared component.
View gist:243355ce77d8e1f7324d
<activity android:name=".MyAppActivity" android:label="@string/app_name" android:theme="@style/Theme.Titanium" android:configChanges="keyboardHidden|orientation" android:alwaysRetainTaskState="true" android:launchMode="singleInstance">
<data android:scheme="myapp" android:host="app"/>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
View gist:10415383
- [ ] Reviewed
- [ ] Tested
- [ ] Approved
joshualambert / hintTextShim
Created Jan 2, 2014
hintText shim for Appcelerator's Titanium allowing hintText to be colored. Simply call this function after creating each textfield, and pass the option isPswd boolean if you're dealing with a password field.
View hintTextShim
// Used to fake hintText coloring to the font color.
// Requires hintText to be defined on the object being passed.
function hintTextShim(uiObject, isPswd) {
uiObject.objectFocus = function () {
if (uiObject.value === uiObject.hintText) {
if (typeof isPswd !== 'undefined' && isPswd === true) {
uiObject.passwordMask = true;
uiObject.value = '';
View gist:6501802
$query = mysqli_query($connection,"INSERT INTO `child_menu_details` (`id`, `parent_id`, `child_id`, `date`, `lunch`, `side1`, `side2`, `side3`, `side4`, `size`, `smoothie`, `orderDate`)
VALUES (NULL, '".$parentid."', '".$childid."', '".$date."' ,'".$lunch."', '".$side1."', '".$side2."', '".$side3."', '".$side4."', '".$size."', '".$smoothie."', '".$orderDate."')");
You can’t perform that action at this time.