Skip to content

Instantly share code, notes, and snippets.

View falkolab's full-sized avatar
🏠
Working from home

Andrey Tkachenko falkolab

🏠
Working from home
  • Russian Federation
View GitHub Profile
@danielfaust
danielfaust / samsung_remote.py
Created May 30, 2011 04:12
Samsung TV Remote Control Python Script
import time
import socket
import base64
src = '192.168.1.2' # ip of remote
mac = '00-AB-11-11-11-11' # mac of remote
remote = 'python remote' # remote name
dst = '192.168.1.3' # ip of tv
app = 'python' # iphone..iapp.samsung
@billdawson
billdawson / android_scons_speedups.md
Created January 11, 2012 21:41
Speeding up Titanium Build

Speeding up Titanium Mobile Build

(The command examples assume OS X).

Just about everything that happens when you enter scons is for Android. So anything you can do to speed up the Android part of our build will be useful.

  • Android NDK r7 can use ccache. We get huge improvements in build time with it. So install it (if you have HomeBrew, brew install ccache) then set a shell variable NDK_CCACHE to point to it. I.e., for me, having installed it with brew, it would be export NDK_CCACHE=/usr/local/bin/ccache.

  • NDK can also parallelize while compiling. Set a shell variable NUM_CPUS to (according to Opie) 2x the number of cores in your machine. A quick way to get the # cores on your machine in OS X is system_profiler | grep "Number Of Cores" in terminal. I have 2 cores, so my shell var setting is export NUM_CPUS=4.

//single calls over bridge
var osname = Ti.Platform.osname,
version = parseInt(Ti.Platform.version);
//simple boolean checks
var isandroid = function() {
return osname === 'android';
};
var isios = function() {
@Mithrandir0x
Mithrandir0x / gist:3639232
Created September 5, 2012 16:15
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@tonylukasavage
tonylukasavage / base.js
Created August 5, 2013 19:31
inheriting event handlers in Alloy
// The base controller event handler, which will get overridden by the derived one
exports.doClick = function(e) {
alert('base click handler');
};
// We have to wait until the object is initialized before applying the event listener. This is so
// the derived listener is used, not the base one. Also, "$" must be used instead of "exports", to
// ensure that the overridden instance of the controller's "doClick" is used, not the exported
// version of the function from the base controller.
exports.init = function(e) {
@tonylukasavage
tonylukasavage / app.js
Created June 2, 2014 14:51
Inject environment variables into Titanium. Makes shared code easier to manage (no more sanitizing keys in repos). Uses Titanium to encrypt the values.
// now you can use it in a titanium app
useSomeApi(Ti.App.Properties.getString('SOME_API_KEY'));
@dextorer
dextorer / strip.conf
Created July 6, 2014 13:01
google-play-services-strip-script
actions=true
ads=true
analytics=true
appindexing=true
appstate=true
auth=true
cast=true
common=true
drive=false
dynamic=true
@robvanoostenrijk
robvanoostenrijk / Instructions.md
Last active September 15, 2021 21:55
Install Mac OS X 10.6 SDK on newer Xcode
@jasonkneen
jasonkneen / elements.js
Last active November 28, 2016 14:26
In the latest TiAlloy you can specify a module tag against the <Alloy> element in XML and this will be used when creating any elements in the view, so you can override, customise etc. The problem is if you want to use multiple commonJS libraries, there's no support in the Alloy Tag -- you'd have to change the module attribute for each element --…
var o = {};
// include the modules you want - purposely did this as seperate lines so it's easier to comment out modules etc
_.extend(o, require("module1"));
_.extend(o, require("module2"));
_.extend(o, require("module3"));
// make available under a single export for use in <Alloy> tag
module.exports = o;
@savelee
savelee / CLI
Last active February 13, 2017 07:38
SENCHA: How to generate a starter app based on a template
//navigate to the ext js 6 folder
sencha package upgrade
sencha generate app -s templates/admin-dashboard/ Dashboard ../my-folder