Skip to content

Instantly share code, notes, and snippets.

View Sophrinix's full-sized avatar

Andrew McElroy Sophrinix

View GitHub Profile
@Sophrinix
Sophrinix / parse.js
Created March 7, 2017 05:28 — forked from stephenfeather/parse.js
Quick library for using the Parse REST API within Appcelerator's Titanium. Building it out as I need different pieces of the API.
// Copyright Stephen Feather and other contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
@Sophrinix
Sophrinix / gist:40c8bb9ff14c4429615d
Created March 28, 2015 17:26
hyperloop-android wtf
➜ hyperloop-android git:(master) ../hyperloop-cli/bin/hyperloop clean compile package launch --src=examples/touches --platform=android
[INFO] Cleaned build
[INFO] Generating library
[INFO] Generating system metabase will take up to a minute (or greater) depending on your environment.This file will be cached and will execute faster on subsequent builds.
◠ Generating system metabase
@Sophrinix
Sophrinix / ios-sim
Created September 22, 2014 12:25
replace ios-sim with this file in titanium 3.3.0 to 3.0.0
#!/bin/zsh
# you need to install npm install -g ios-sim before this will work
# there is an irony in the fact that ios-sim is phonegap's version, but it was forked from Jeff Haynie (CEO Appcelerator)
ios-sim $1 $2 $5 $6 $7 $8
@Sophrinix
Sophrinix / gist:70c757e8f1e4bf4578ff
Created May 12, 2014 18:37
Jenkins config for TiConf 2014 NY talk
cd ~/Desktop/ticonf2014testappdemo/alloytest
titanium clean
titanium build --platform=iphone --test &
sleep 30
killall "iPhone Simulator"
export PATH="/Users/andrewmcelroy/.rbenv/shims:/Applications/Postgres.app/Contents/MacOS/bin:/Users/andrewmcelroy/bin:/usr/local/bin:/Users/andrewmcelroy/.rbenv/bin:/Users/andrewmcelroy/android/tools:/Users/andrewmcelroy/android/:/Users/andrewmcelroy/android//tools:/Users/andrewmcelroy/android/platform-tools/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/Users/andrewmcelroy/.ec2/bin"
echo | titanium calabash --platform=iphone
reset="\033[0;0m"
dir_color="\033[0;32m"
git_color="\033[2;37m"
ti_color="\033[2;36m"
alloy_color="\033[0;36m"
prompt_color=$reset
find-up() {
path=$(pwd)
while [[ "$path" != "" && ! -e "$path/$1" ]]; do
@Sophrinix
Sophrinix / _build.js
Last active June 14, 2019 01:52
complete file 3.2.0.v20131205165947/iphone/cli/commands/_build.js lines 2774 to 2783 fix the issue of Settings.bundle failing to load.
/**
* iOS build command.
*
* @module cli/_build
*
* @copyright
* Copyright (c) 2009-2013 by Appcelerator, Inc. All Rights Reserved.
*
* @license
* Licensed under the terms of the Apache Public License
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<application>
<activity android:name=".HipsterdashActivity"
android:label="hipsterdash" android:theme="@style/Theme.Titanium"
android:configChanges="keyboardHidden|orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.HOME"/>
@Sophrinix
Sophrinix / gist:6448649
Created September 5, 2013 10:51
an example of AndroidManifest.xml which makes your app a launcher.
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
@Sophrinix
Sophrinix / gist:6396850
Created August 31, 2013 08:01
UITableViewCellEditingStyleInsert in titanium mobile as styleInsert
// Allows customization of the editingStyle for a particular cell located at 'indexPath'. If not implemented, all editable cells will have UITableViewCellEditingStyleDelete set for them when the table has editing property set to YES.
- (UITableViewCellEditingStyle)tableView:(UITableView *)ourTableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
RETURN_IF_SEARCH_TABLE_VIEW(UITableViewCellEditingStyleNone);
TiUITableViewRowProxy *row = [self rowForIndexPath:indexPath];
//Yes, this looks similar to canEdit, but here we need to make the distinction between moving and editing.
//Actually, it's easier than that. editable or editing causes this to default true. Otherwise, it's the editable flag.
if ([TiUtils boolValue:[row valueForKey:@"editable"] def:editable || editing])
{
#! /bin/bash
# inspired by Greg McCormick's (@crushmedianet) post
# http://crushmedia.net/2012/04/23/automated-build-of-titanium-iconloading-files/
# updated 4 Aug 2012: creates clipped iPad backgrounds by cropping 768x1024, etc.
# create following base images + save in APPNAME/Resources/:
# appicon-android-512x512.png