Skip to content

Instantly share code, notes, and snippets.

View AppWerft's full-sized avatar

Rainer Schleevoigt AppWerft

View GitHub Profile
var Bonjour = require('BCB.bonjourService');
var serviceBrowser = Bonjour.createBrowser({
serviceType : '_smb._tcp.',
domain : 'local.'
});
var update_services = function(e) {
Titanium.API.info(JSON.stringify(e));
services = e['services'];
for (var i = 0; i < services.length; i++) {
var service = services[i];
rainers-mbp:ios fuerst$ python build.py
Build settings from command line:
SDKROOT = iphoneos8.1
=== BUILD TARGET ticarousel OF PROJECT ticarousel WITH CONFIGURATION Release ===
Check dependencies
CompileC build/ticarousel.build/Release-iphoneos/ticarousel.build/Objects-normal/armv7/TransformParser.o Classes/TransformParser.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/fuerst/Downloads/TiCarousel-master/mobile/ios
@AppWerft
AppWerft / gist:73129b6ca56a788f00a6
Last active August 29, 2015 14:16
mapview in drawer
var Geo = new (require('controls/geotracking'))(),
Map = require('ti.map'),
region = Ti.App.Properties.getObject('REGION', {
latitude : 50.4,
longitude : 11,
latitudeDelta : 20,
longitudeDelta : 20
});
var stations = ['dlf', 'drk', 'drw'];
var TiDrawerLayout = require('com.tripvi.drawerlayout');
/*
* This module shows how you can cache remote SQLite databases
* Parameters:
* url<String> == url of database
* numberoftables<Number> = aspected count of tables in database (optional)
* aspecttables<Array> = aspected table names (optional)
* Methods:
* loadDB == start mirroring
* isDBvalide == tests Module on tablecount
* Events:
@AppWerft
AppWerft / gist:2fb93d07f680adf5bd64
Created March 25, 2015 14:25
Android videoplayer
module.exports = function(_args) {
if (Ti.Network.online == false)
return;
var self = Ti.UI.createWindow({
fullscreen : true,
backgroundColor : '#444',
theme : 'Theme.NoActionBar',
orientationModes : [Titanium.UI.LANDSCAPE_LEFT, Titanium.UI.LANDSCAPE_RIGHT]
});
self.add(Ti.UI.createImageView({
@AppWerft
AppWerft / gist:ca7113b78edd687fa308
Created March 30, 2015 13:01
Pebble communication
var Pebble = require('com.mcongrove.pebble'),
Moment = require('vendor/moment'),
alarmManagerModule = require('bencoding.alarmmanager');
alarmManagerModule.enableLogging();
var Модул = function(_args) {
Pebble.setAppUUID("226834ae-786e-4302-a52f-6e7efc9f990b");
var seconds = Moment(_args.time_isostring).unix() - Moment().unix();
this.alarmManager = alarmManagerModule.createAlarmManager();
this.alarmManager.addAlarmNotification({
var extractKeys = function (obj) {
var keys = [], key;
for (key in obj) {
Object.prototype.hasOwnProperty.call(obj,key) && keys.push(key);
}
return keys;
}
var extractKeys = function(obj) {
var keys = [],
key;
for (key in obj) {
Object.prototype.hasOwnProperty.call(obj, key) && keys.push(key);
}
return keys;
}
var sorter = function(a, b) {
return parseFloat(a) - parseFloat(b);
[INFO] : WebViewFactory: Loading com.google.android.webview version 40 (1832189-arm) (code 424501)
[INFO] : LibraryLoader: Time to load native libraries: 2 ms (timestamps 7935-7937)
[INFO] : LibraryLoader: Expected native library version number "",actual native library version number ""
[INFO] : chromium: [INFO:library_loader_hooks.cc(108)] Chromium logging enabled: level = 0, default verbosity = 0
[INFO] : BrowserStartupController: Initializing chromium process, singleProcess=true
[WARN] : art: Attempt to remove local handle scope entry from IRT, ignoring
[WARN] : chromium: [WARNING:resource_bundle.cc(304)] locale_file_path.empty()
[INFO] : chromium: [INFO:aw_browser_main_parts.cc(63)] Load from apk succesful, fd=52 off=35788 len=3738
[INFO] : chromium: [INFO:aw_browser_main_parts.cc(76)] Loading webviewchromium.pak from, fd:53 off:390788 len:1143511
[WARN] : AudioManagerAndroid: Requires BLUETOOTH permission
module.exports = function(_video) {
var self = require('ui/win')({
videoItem : _video,
title : Ti.Android ? 'Wein Videos' : _video.title,
subtitle : _video.title,
layout : 'vertical'
});
self.add(Ti.UI.createImageView({
image : 'http://i.ytimg.com/vi/' + _video.video + '/maxresdefault.jpg',
top : 0,