Skip to content

Instantly share code, notes, and snippets.

View ricardoalcocer's full-sized avatar
💭
making music at https://alcomusic.com

Alco ricardoalcocer

💭
making music at https://alcomusic.com
View GitHub Profile
@mauropm
mauropm / app.js
Created July 4, 2013 00:22
An example of generic app with different actions according to the button. It's showing how to manage the destruction of the window after you use it, and other nice things. To use: Create a new classic mobile project in Titanium Studio, and copy all this files to Resources directory. This is intended to work with Titanium Mobile SDK 3.1.1.GA, wit…
// INcluding memory management utils.
Ti.include('utils.js');
// root window.
var win = Ti.UI.createWindow({
backgroundColor:'white',
exitOnclose:true,
});
@tsteur
tsteur / alloy.jmk
Created July 15, 2013 22:12
Simple build configuration file for Titanium Mobile Alloy. It extends the destroy method of each controller to automatically remove all event listeners which are defined in the view (XML).
function readContentFromFile(file)
{
return require('fs').readFileSync(file).toString();
}
function writeContentToFile(file, content)
{
require('fs').writeFileSync(file, content);
}
@FokkeZB
FokkeZB / app.js
Created August 22, 2013 09:54
How to know if your Android device is LONG or NOTLONG?
http://developer.android.com/guide/topics/resources/providing-resources.html#ScreenAspectQualifier
if ((Ti.Platform.displayCaps.platformWidth / Ti.Platform.displayCaps.platformHeight) < (((Ti.Gesture.orientation === Ti.UI.LANDSCAPE_LEFT)) ? (320 / 240) : (240 / 320)))) {
Ti.API.info('I am LONG');
} else {
Ti.API.info('I am NOTLONG');
}
@benbahrenburg
benbahrenburg / AddingFetchToSDK.md
Last active August 13, 2016 17:28
This gist outlines an approach for adding the fetch background mode to Titanium

This document details how to add the background mode of fetch into the Titanium SDK. It is important to note that once these updates are performed you will be able to attach a listener to be called when the fetch background mode is triggered.

After the below updates are made, you can clear your Titanium project and run this sample app.js to view how it works.

TiBase.h and TiBase.m updates

The first step in adding the fetch background mode is to create the const values that will later be used when adding or listening to notification center.

To do this first open the TiBase.h file and add the const of

find-up() {
local path=$(pwd)
while [[ "$path" != "" && ! -e "$path/$1" ]]; do
path=${path%/*}
done
if [ "$path" != "" ]
then
echo "$path"
fi
}
@chrisknepper
chrisknepper / gcal_link.php
Created July 18, 2014 03:51
PHP Google Calendar Link Generator
@erdem
erdem / countries.json
Last active May 30, 2024 22:37
Country list as JSON format. fields: name, coordinates, timezones, country code and capital resource: https://github.com/mledoze/countries
[
{
"timezones": [
"America/Aruba"
],
"latlng": [
12.5,
-69.96666666
],
"name": "Aruba",
@dreamsparkx
dreamsparkx / More-links.txt
Last active June 6, 2024 21:01
Install Apache, PHP, MySQL and phpMyAdmin on Mac OS X
@citruz
citruz / QEMU_ON_M1.md
Last active June 6, 2024 08:29
Create Ubuntu and Windows VMs with QEMU on Apple Silicon

Running Linux and Windows on M1 with QEMU

30.11.2020: Updated with the new patchseries and instructions for Windows

02.12.2020: Added tweaks

08.12.2020: Updated with patchseries v4

31.01.2020: Updated with patchseries v6