Skip to content

Instantly share code, notes, and snippets.

@kriegsman
kriegsman / TwinkleFOX.ino
Last active Jan 19, 2023
TwinkleFOX: Colored Twinkling Holiday Lights
View TwinkleFOX.ino
#include "FastLED.h"
#if defined(FASTLED_VERSION) && (FASTLED_VERSION < 3001000)
#warning "Requires FastLED 3.1 or later; check github for latest code."
#endif
#define NUM_LEDS 100
#define LED_TYPE WS2811
#define COLOR_ORDER GRB
@falkolab
falkolab / SVGProduct.js
Created Oct 30, 2015
How to use SVG as autogenerated raster image
View SVGProduct.js
// app/lib/SVGProduct.js
function getImageFileFromSVG(svgOpts, name) {
var file = Ti.Filesystem.getFile(Ti.Filesystem.applicationCacheDirectory,
Ti.Utils.md5HexDigest(JSON.stringify(svgOpts)));
if (!file.exists()) {
var SVG = require('com.geraudbourdin.svgview');
if (!file.write(SVG.createView(svgOpts).toImage())) {
Ti.API.error("Can't save to file. Product:", name);
return null;
@FokkeZB
FokkeZB / .bash_profile
Created Oct 3, 2014
Alias for making screenshots from connected Android device/emulator
View .bash_profile
alias screenshot='adb shell screencap -p | perl -pe "s/\x0D\x0A/\x0A/g" > "/Users/fokkezb/Downloads/android_$(date +%Y%m%d-%H%M%S).png"'
# NOTE: Replace 'fokkezb' with your user. You cannot use ~ when using $() unfortunately
@kwhinnery
kwhinnery / howto.md
Created May 13, 2013
Execute "tishadow run" in your Titanium app directory whenever a JavaScript file changes.
View howto.md

Automatic TiShadow Installs

Execute "tishadow run" in your Titanium app directory whenever a JavaScript file changes. Edit your JS files in a text editor, save, then switch to the test device or simulator. Profit.

Install supervisor

[sudo] npm install -g supervisor

Execute tishadow run anytime a JavaScript file changes

@stephenfeather
stephenfeather / waze.js
Last active Aug 24, 2017
Appcelerator Titanium module for Waze
View waze.js
// 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:
//
@stephenfeather
stephenfeather / parse.js
Last active Mar 1, 2022
Quick library for using the Parse REST API within Appcelerator's Titanium. Building it out as I need different pieces of the API.
View parse.js
// 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:
//
View Component.js
//Wrapper class to create extensible Titanium components
function Component(/*Object*/ tiView) {
var self = {
__viewProxy:tiView
};
//passthrough for add
self.add = function(/*Object*/ tiChildView) {
var v = tiChildView.__viewProxy||tiChildView;
self.__viewProxy.add(v);
@jeffbonnes
jeffbonnes / tracer.js
Created Sep 12, 2011
A tracer object to Titanium Mobile to show elapsed time and memory usage
View tracer.js
var tracer = {};
(function() {
tracer.levels = {};
tracer.levels.DEBUG = 1;
tracer.levels.INFO = 2;
tracer.levels.WARN = 3;
tracer.levels.ERROR = 4;
tracer.levels.OFF = 5;
tracer.allTracers = [];