Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
Busy being awesome!

Brenton House brentonhouse

🚀
Busy being awesome!
View GitHub Profile
@brentonhouse
brentonhouse / backup.sh
Created Mar 11, 2021 — forked from jmcerrejon/backup.sh
Zip the current Titanium project on macOS
View backup.sh
#!/usr/bin/bash
#
# Description: Zip the current Titanium project on macOS
# File: backup.sh
# Author: Jose Cerrejon (ulysess_at_gmail.com)
# Help: Copy in the root of your Titanium project and Add to package.json the script: "backup": "sh backup.sh",
#
clear
stop_liveview() {
@brentonhouse
brentonhouse / api.js
Created Jan 20, 2021 — forked from cyberwombat/api.js
Walmart API authentication in Node
View api.js
import { createSign, randomBytes } from 'crypto'
import axios from 'axios'
import { resolve } from 'url'
const PK_HEADER = '\n-----BEGIN PRIVATE KEY-----\n'
const PK_FOOTER = '\n-----END PRIVATE KEY-----\n'
const BASE_URL = 'https://marketplace.walmartapis.com/'
const WALMART_CONSUMER = "b68d2a72....";
@brentonhouse
brentonhouse / index.js
Created Jan 19, 2021 — forked from lbrenman/index.js
Titanium Local Notifications Example
View index.js
function doClick(e) {
alert($.label.text);
}
$.index.open();
var alertFields = {
title: 'Notification', //Android Only
body : 'Just another notification',
badge: 1,
@brentonhouse
brentonhouse / spriteSheetAnimator.js
Created Dec 24, 2020 — forked from jabubuck/spriteSheetAnimator.js
Sample project that animates single row sprite sheets(I will later add support for multiple rows/animations for single sprites) This is for Titanium iOS and Android
View spriteSheetAnimator.js
//"THE BEER-WARE LICENSE": As long as you retain this notice you can do whatever you want with this stuff.
//If we meet some day, and you think this stuff is worth it, you can buy me a beer in return Jamie Buckley
var win = Ti.UI.createWindow({
backgroundColor: 'black',
fullscreen: true,
width: Ti.Platform.displayCaps.platformWidth,
height: Ti.Platform.displayCaps.platformHeight
});
@brentonhouse
brentonhouse / README.md
Created Dec 3, 2020 — forked from hansemannn/README.md
Titanium iOS In-App-Purchase / Storekit
View README.md

Titanium In-App-Purchasing

Support the native in-app-purchasing API's in Titanium.

Example

var IAP = require('ti.iap');

var PRODUCT_IDENTIFIER = 'YOUR_PRODUCT_IDENTIFIER';
@brentonhouse
brentonhouse / git-tag.js
Created May 23, 2020 — forked from omrilotan/git-tag.js
Create a tag by the last commit's author with it's message (example for async getters)
View git-tag.js
const asyncExec = require('util').promisify(require('child_process').exec);
/**
* Execute command line in a child process
* @param {...String} args Commands
* @return {String}
*/
async function exec (...args) {
const { stdout, stderr } = await asyncExec(...args);
@brentonhouse
brentonhouse / MOCK_DATA.js
Created May 14, 2020 — forked from lbrenman/MOCK_DATA.js
Arrow - How to Populate Your Arrow Builder Project With Data
View MOCK_DATA.js
module.exports = {
data: [
{"Name":"Demivee","Type":"Prospect","Phone":"1-(818)173-8443"},
{"Name":"Shufflester","Type":"Prospect","Phone":"93-(232)869-5557"},
{"Name":"Voonte","Type":"Customer","Phone":"62-(269)473-1186"},
{"Name":"Thoughtsphere","Type":"Prospect","Phone":"86-(902)994-3017"},
{"Name":"Zoonder","Type":"Customer","Phone":"1-(202)358-2758"},
{"Name":"Flashspan","Type":"Customer","Phone":"57-(126)114-4912"},
{"Name":"Yoveo","Type":"Customer","Phone":"593-(320)380-5127"},
@brentonhouse
brentonhouse / base.js
Created May 6, 2020 — forked from samueleastdev/base.js
Appcelerator requesting location permissions
View base.js
/*
* function to check for all location services outcomes
*/
function requestLocationPermissions(authorizationType, callback) {
// FIXME: Always returns false on Android 6
// https://jira.appcelerator.org/browse/TIMOB-23135
if (OS_IOS && !Ti.Geolocation.locationServicesEnabled) {
return callback({
success : false,
@brentonhouse
brentonhouse / index.js
Created Apr 29, 2020 — forked from jasonkneen/index.js
Appcelerator swipe card like tinder
View index.js
var win = Titanium.UI.createWindow({
backgroundColor: "#ffffff",
title: "win"
});
// animations
var animateLeft = Ti.UI.createAnimation({
left: -520,
transform: Ti.UI.create2DMatrix({rotate: 60}),
opacity: 0,
View appc_func_decode-jwt.js
/**
* token
* claim = "registered" || "public" || "private"
*/
exports.decodeJWT = function(token, claim) {
var base64Url;
if (claim == "registered") {
base64Url = token.split('.')[0];
} else if (claim == "private") {
base64Url = token.split('.')[2];