Skip to content

Instantly share code, notes, and snippets.

View samueleastdev's full-sized avatar

Samuel East samueleastdev

View GitHub Profile
@samueleastdev
samueleastdev / index.js
Created November 29, 2016 02:21
Appcelerator MapView showAnnotations Android
var returnData; // returned array of location data
if (OS_IOS) {
$.MapView.showAnnotations(annotationArray);
}
if (OS_ANDROID) {
@samueleastdev
samueleastdev / index.js
Created November 29, 2016 02:54
Filter out unique array of objects and return full object using array filter
var dt = [{"address":"Caër, 27930 Normanville, France","longitude":1.172397,"latitude":49.066906},{"address":"Caër, 27930 Normanville, France","longitude":1.172397,"latitude":49.066906},{"address":"Same, Tanzania","longitude":37.750342,"latitude":-4.0666225},{"address":"Caerphilly CF83, UK","longitude":-3.218134,"latitude":51.578829},{"address":"Caerphilly CF83, UK","longitude":-3.218134,"latitude":51.578829},{"address":"Caerphilly CF83, UK","longitude":-3.218134,"latitude":51.578829},{"address":"Caerphilly CF83, UK","longitude":-3.218134,"latitude":51.578829},{"address":"Caër, 27930 Normanville, France","longitude":1.172397,"latitude":49.066906}];
var flags = {};
var dt = dt.filter(function(entry) {
if (flags[entry.address]) {
return false;
}
flags[entry.address] = true;
return true;
});
@samueleastdev
samueleastdev / index.js
Created November 30, 2016 03:15
Appcelerator Android Date and Time picker
/*
* Open Titanium.UI.PICKER_TYPE_DATE
*/
if (CONFIG.properties.type === 2) {
picker.showDatePickerDialog({
value: new Date(),
callback: function(_event) {
var date = _event.value;
@samueleastdev
samueleastdev / info.txt
Last active December 2, 2016 22:42
Install Appcelerator Android SDK and NDK
Download and install android SDK
https://developer.android.com/studio/index.html
Install the NDK
From an open project, select Tools > Android > SDK Manager from the main menu.
Click the SDK Tools tab.
Check the boxes next to LLDB, CMake, and NDK, as shown in figure 1.
# run appc setup and appc info
Go back to the sdk manager in android studio and click launch standalone sdk manager select the correct version of the build tools insatll 23.0.3
@samueleastdev
samueleastdev / shell.sh
Created December 8, 2016 20:49
Appcelerator Android submission failed error - "keystore" as alias name fails
#first make sure you have the JDK tools installed http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
appc run -p android -T dist-playstore -K keystore/shakelocate -P sletnisy8289 -L shakelocate -O ~/Desktop
@samueleastdev
samueleastdev / index.js
Last active December 12, 2016 09:34
Cross Platform Maps Appcelerator
var permissions = require("mapPermissions");
var RunLocation = false;
var search = {
latitude : 51.576339,
longitude : -3.216717,
heading : null
};
/**
@samueleastdev
samueleastdev / bash.sh
Last active January 19, 2017 22:24
Setting Up New Appc Git Repo From Scratch
# Obviously setup you ssh keys
git init
git remote add origin https://github.com/samueleastdev/appc.push.notifications.git
git add .
git commit -m "first commit"
git push --set-upstream origin master
# you will probabaly get a error at this stage due to the readme
git pull origin master --allow-unrelated-histories
@samueleastdev
samueleastdev / install.sh
Created January 4, 2017 16:36
Installing FFmpeg with all available options using brew
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools
@samueleastdev
samueleastdev / shell.sh
Created January 4, 2017 17:55
Node js updating version with brew for appcelerator
sudo chown -R $USER /usr/local
brew doctor
brew install node@4
brew link --overwrite node@4
@samueleastdev
samueleastdev / index.json
Created January 17, 2017 17:30
Lambda Integration Request Mapping Template
{
"body" : $input.json('$'),
"headers": {
#foreach($header in $input.params().header.keySet())
"$header": "$util.escapeJavaScript($input.params().header.get($header))" #if($foreach.hasNext),#end
#end
},
"method": "$context.httpMethod",
"params": {