Skip to content

Instantly share code, notes, and snippets.

View coomsie's full-sized avatar

coomsie coomsie

View GitHub Profile
@coomsie
coomsie / validation.js
Created May 5, 2011 10:16
form validation for titaniuim mobile projects
//UI for valiation
function validationMessages() {
//*** 'me' acts as an alias that can be used within the methods
var me = this;
var imgPath=Ti.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory,"images/bubble.png");
validationMessages.totalErrors =0;
validationMessages.reqdfieldsRemaining=0;
@coomsie
coomsie / gist:1156622
Created August 19, 2011 11:35
Titanium web server using sockets - but has issues
///create listener to send tiles
var connectedSockets = [];
var acceptedCallbacks = {
error : function(e) {
Ti.UI.createAlertDialog({
title:"Socket error: "+e.socket.host,
@coomsie
coomsie / downloadosmtilestosqlite.pl
Created December 6, 2011 19:14
download tms tiles to insert into sqlite db
#! /usr/bin/perl
# 2011
# added a few mods to script to allow to be pushed into sqlite
# coomsie at gmail.com
use 5.006001;
use strict;
use warnings;
@coomsie
coomsie / gist:1442148
Created December 7, 2011 09:25 — forked from leplatrem/gist:1415767
Leaflet Offline Tiles using SQL Storage
/*
* L.TileLayer.LocalCache : A tile layer using SQL Storage, if available.
*/
L.TileLayer.LocalCache = L.TileLayer.extend({
options: {
minZoom: 0,
maxZoom: 18,
tileSize: 256,
subdomains: 'abc',
@coomsie
coomsie / gist:1446773
Created December 8, 2011 11:36 — forked from leplatrem/gist:1415767
Leaflet Offline Tiles using SQL Storage
/*
* L.TileLayer.LocalCache : A tile layer using SQL Storage, if available.
*/
L.TileLayer.LocalCache = L.TileLayer.extend({
options: {
minZoom: 0,
maxZoom: 18,
tileSize: 256,
subdomains: 'abc',
/*
* Needs a tile layer, something like (for Leaflet) ..
*
* var tl = L.tileLayer("content://com.pahasapatrails.m.tiles/{style}/{z}/{x}/{y}.png",
* { style: "XXX", minZoom: 9, maxZoom: 13, tms: true });
* map.addLayer(tl);
*
*
* Also needs a provider entry under the application tag in the Android
* Manifest, something like the following ..
@coomsie
coomsie / ft.js
Created January 27, 2014 08:55 — forked from macdonst/ft.js
var remoteFiles = [];
function downloadRemotePDF() {
var local2User = JSON.parse( localStorage["locallessons"] );
$.each(local2User, function(key) {
remoteFiles.push(optionsJSON + local2User[key].idcountries + '/' + local2User[key].idcurriculum + '/' + local2User[key].idoptions + '/pdf/' + local2User[key].pdfname);
}
downloadFile();
}
'use strict';
/**
* services.cordova Module
*
* General Cordova services module
*/
angular.module('bili.services.cordova')
'use strict';
/**
* services.cordova Module
*
* General Cordova services module
*/
angular.module('bili.services.cordova')
'use strict';
/**
* services.cordova Module
*
* General Cordova services module
*/
angular.module('bili.services.cordova')