Skip to content

Instantly share code, notes, and snippets.

View jbalthis's full-sized avatar
:octocat:
coding

Jason Balthis jbalthis

:octocat:
coding
View GitHub Profile
@jbalthis
jbalthis / GitHub-Project-Guidelines.md
Created May 21, 2023 10:46 — forked from rsp/GitHub-Project-Guidelines.md
Git Strict Flow and GitHub Project Guidelines - setup rules and git flow for commercial and open-source projects by @rsp

Git Strict Flow and GitHub Project Guidelines

Or how to turn this:

into this:

#!/usr/bin/env node
// the pathname of the url without the leading '/' is used as softoken pin
// so make the call with http://localhost:8000/<softoken-pin>
const https = require('https'),
fs = require("fs"),
url = require('url'),
exec = require('child_process').exec;
@jbalthis
jbalthis / app.js
Created February 26, 2014 01:25 — forked from aaronksaunders/app.js
// create model factory, pass in Alloy global object
var MODELS = new (require('models').MODELS)(Alloy);
var person = new MODELS.Person({
"name" : "Reina Saunders",
"age" : 2
});
person.save(null, {
"success" : function(_m, _r) {

TiAgent

Ti Agent is light-weight progressive ajax API crafted for flexibility, readability, and a low learning curve after being frustrated with many of the existing request APIs.

 request
   .post('/api/pet')
   .data({ name: 'Manny', species: 'cat' })
   .set('X-API-Key', 'foobar')
   .set('Accept', 'application/json')

.end(function(res){

@jbalthis
jbalthis / app.js
Created February 26, 2014 01:21 — forked from aaronksaunders/app.js
var get_file = function(url, callback) {
var xhr = Ti.Network.createHTTPClient({
onload: function(e) {
// this function is called when data is returned from the server and available for use
// this.responseText holds the raw text return of the message (used for text/JSON)
// this.responseXML holds any returned XML (including SOAP)
// this.responseData holds any returned binary data
console.log('downloaded '+ url);
callback({
function doClickMenu(evt){
alert(evt.source.title);
}
// we need to do some things to the Window once it is properly instanciated, so we add an event listener to its OPEN event
$.win.addEventListener('open',function(){
var actionBar = $.win.activity.actionBar; // get a handle to the action bar
actionBar.title='My App'; // change the App Title
actionBar.displayHomeAsUp=true; // Show the "angle" pointing back
actionBar.onHomeIconItemSelected = function() { // what to do when the "home" icon is pressed
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff',
layout: 'vertical'
});
var bt1 = Ti.UI.createButton({title: 'send message (method 1)', top: 200});
bt1.addEventListener('click', function(e)
/* Window and View Styling */
'.container': {
height: Ti.UI.FILL,
width: Ti.UI.FILL,
backgroundColor: 'white'
}
/* TabGroup styling */
'#tabGroup':{
@jbalthis
jbalthis / app.js
Created February 7, 2014 18:41 — forked from dawsontoth/app.js
Ti.include('overrideTabs.js');
/*
This is a typical new project -- a tab group with three tabs.
*/
var tabGroup = Ti.UI.createTabGroup();
/*
Tab 1.
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff',
layout: 'vertical'
});
var bt1 = Ti.UI.createButton({title: 'send message (method 1)', top: 200});
bt1.addEventListener('click', function(e)