Skip to content

Instantly share code, notes, and snippets.

@rnystrom
rnystrom / RN3DTouchGestureRecognizer.swift
Last active February 3, 2018 22:58
RN3DTouchGestureRecognizer
//
// RN3DTouchGestureRecognizer.swift
//
// Created by Ryan Nystrom on 10/10/15.
// Copyright © 2015 Ryan Nystrom. All rights reserved.
//
import UIKit.UIGestureRecognizerSubclass
class RN3DTouchGestureRecognizer: UIGestureRecognizer {
@ronhornbaker
ronhornbaker / twitter-friends.rb
Last active May 25, 2017 00:21
Get list of friends of a Twitter user, using the Twitter gem v5 (https://github.com/sferik/twitter), the Twitter APIv1.1, and Ruby.
require 'rubygems'
require 'twitter'
# see https://github.com/sferik/twitter
def twitter_client
Twitter::REST::Client.new do |config|
config.consumer_key = "XXXXXX"
config.consumer_secret = "XXXXXX"
config.access_token = "XXXXXX"
@ricardoalcocer
ricardoalcocer / actionbarhelper.js
Last active December 24, 2015 06:09
NOTE: I HAVE CREATED A FULL SAMPLE APP LOCATED AT https://github.com/ricardoalcocer/tiactionbarhelper. ANY UPDATES TO THE LIBRARY WILL BE MADE ON THAT REPO, SO THIS VERSION WILL BE OUTDATED. CommonJS module for working with the ActionBar in Titanium.
/*
* ActionBar Helper Class for Appcelerator Titanium
* Author: Ricardo Alcocer
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://alco.mit-license.org/
*
@jasonkneen
jasonkneen / 1readme.md
Last active May 28, 2021 16:48
Quick example of registering a URLScheme in a Titanium app using the TiApp.xml without info.plist file. Just add the following into your TiApp.xml (I put it under the </iphone> tag. Works on Android and iOS.

Quick Example of registering a scheme in TiApp.xml, implementing the code in app.js / alloy.js

@aaronksaunders
aaronksaunders / app_snippet.js
Last active July 11, 2020 14:07
One way to do bulk updates and deletes with Appcelerator Alloy Collections
// add all items to collection
Alloy.Collections.Fugitive.reset([{
"name" : "Jeff Haynie"
}, {
"name" : "Nolan Wright"
}, {
"name" : "Don Thorp"
}, {
"name" : "Marshall Culpepper"
}, {
@nvdnkpr
nvdnkpr / index.js
Created December 5, 2012 18:06 — forked from ricardoalcocer/index.js
Basic Alloy : Dynamic TableView Handling
function showItems(e) {
Ti.API.info(e.rowData.itemName);
}
var rowData=[];
for(var i=1;i<=10;i++){
var payload={
rowId:i,
itemName:'Test' + i
}
@pec1985
pec1985 / app.js
Created May 17, 2012 23:45
Easy SplitView controller - iPad, Titanium
var SplitView = require('splitview');
/**
* SplitView Public Methods:
*
* split.initWithMasterAndDetailWindows( Ti.UI.Window, Ti.UI.Window );
* split.openInMaster( Ti.UI.Window )
* split.openInDetail( Ti.UI.Window )
@pec1985
pec1985 / deleterow.js
Created June 10, 2011 01:35
delete a row in a table view in android
var win = Ti.UI.createWindow({
backgroundColor:'#ccc'
});
// create the table view
var tableView = Ti.UI.createTableView({});
// create an empty array
var data = [];
// this is the alert message + deleting the row from the array
function confirmDel(rowId,rowName) {
@ordinz
ordinz / goog.js
Created March 29, 2011 17:02
Convert a remote Google KML file to Appcelerator MapView Routes
var url = "http://maps.google.com/maps/ms?ie=UTF&msa=0&msid=217110902183005084784.00049d962454fabcabdc2&output=kml";
//Add routes from a remote KML file to one map
goog.maps.kml.addRoutesToMap(mySingleMap, url);
//Multiple Maps
goog.maps.kml.addRoutesToMap([myGoogleMap1, myGoogleMap2], url);