Skip to content

Instantly share code, notes, and snippets.

View SquirrelMobile's full-sized avatar

Squirrel SquirrelMobile

View GitHub Profile
@SquirrelMobile
SquirrelMobile / file.js
Created February 5, 2020 05:40
Send file in form-data with Axway Titanium mobile Appcelerator
var pathToFile = "YOUR PATH TO FILE HERE";
var baseurlAPI = "YOUR API BASEURL HERE";
var file = Ti.Filesystem.getFile(pathToFile);
if(file.exists()){
var xhr = Ti.Network.createHTTPClient({
onload: function(e) {
Ti.API.log('success '+this.responseText);
},
onerror: function(e) {
@SquirrelMobile
SquirrelMobile / Utils.java
Last active April 19, 2018 06:56
Get the Timezone including daylight saving time on Android Java
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;
import java.util.concurrent.TimeUnit;
// Get the "real" offset timezone in hours
public static int getTimeZone(){
Calendar mCalendar = new GregorianCalendar();
TimeZone mTimeZone = mCalendar.getTimeZone();
0410c9a121ae23a5e208edc379f64f7c8b1c28b46a62cd93cb77885631977c043acdcf299b5b1c3506100cfe752a7f6799d924d5cf645b225b0db19b5d058beae2
@SquirrelMobile
SquirrelMobile / alloy.js
Created January 30, 2018 12:05
Upload large video from Axway Titanium mobile application (iOS / Android) and save the video with PHP script
//Download and install widget loader : https://github.com/FokkeZB/nl.fokkezb.loading
Alloy.Globals.loading = Alloy.createWidget("nl.fokkezb.loading");
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>tracking.js - face hello world</title>
<link rel="stylesheet" href="assets/demo.css">
<script src="../build/tracking-min.js"></script>
<script src="../build/data/face-min.js"></script>
@SquirrelMobile
SquirrelMobile / alloy.js
Last active September 29, 2017 06:47
Handle versioning of your Axway Titanium application
(function constructor(){
require('install')();
})();