Skip to content

Instantly share code, notes, and snippets.

View shouse's full-sized avatar

Steven shouse

  • SIVCI
  • Kansas City, MO
View GitHub Profile
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)
@shouse
shouse / ti.getViewByClass.js
Last active September 22, 2017 19:50
Iterate through titanium views and look for class
/**
* @function getViewByClass
* @summary This will take a class and an optional parent and find children with that class
* @param {string} _class Class name
* @param {object} _parent Optional Parent View to iterate through
* @param {number} _depth Optional depth of recursiveness
* @returns {array} Array of views with the class
*
* @TODO Implement _depth and recursive calls
*/
@shouse
shouse / docker-resources.md
Last active March 10, 2022 04:39 — forked from rgaidot/docker-resources.md
Docker Resources All In One - A collection of docker online resources
@shouse
shouse / osx-for-hackers.sh
Created October 16, 2015 04:27 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned. Also, please don't email me about this script, my poor inbox...
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'

KVM OSX Guest 10.11 (El Capitan) with Clover

  • Some notes about this approach:
    • An OSX Installer USB drive for Install OS X El Capitan is created
    • Clover is then installed on the USB drive
    • Clover Configurator is then run on the USB drive
    • The USB drive contents are copied to the VM host
    • VNC is used to connect to the guest UI
  • The qxl virtual video device is used (part of the standard kvm qemu install)
{
"events": [
{
"media": {
"url": "http://media.web.britannica.com/eb-media/42/24042-004-C8F9C0D5.jpg",
"caption": "Thomas Edison's phonograph"
},
"start_date": {
"year": "1877"
},
@shouse
shouse / ti.dynamiclib.js
Created January 28, 2017 16:18 — forked from hansemannn/ti.dynamiclib.js
Support embedded binaries (aka dynamic libraries) in Titanium modules and Hyperloop
/**
* Ti.DynamicLib
* @abstract Support embedded binaries (aka dynamic libraries) in Titanium modules and Hyperloop.
* @version 1.1.0
*
* Install:
* 1) Search and replace '../../src/<YourFramework>.framework' with your framework location.
The path is relative to the `build/iphone` directory.
* 2a) For classic modules:
* - Add 'LD_RUNPATH_SEARCH_PATHS=$(inherited) "@executable_path/Frameworks" $(FRAMEWORK_SEARCH_PATHS)'
@shouse
shouse / page.indicator.js
Created March 9, 2017 03:38 — forked from giorgiopagnoni/page.indicator.js
Page indicator (circles, lines, squares...) for scrollableViews for Appcelerator Titanium (Android)
/*
* Simple page indicator for scrollableViews for Appcelerator Titanium (Android).
* To be added after the views have been set.
*
* var p = require('page.indicator');
* var options = { color: 'red' };
* var indicator = p.pageIndicator(myScrollableView, options);
*/
/*
* Below is the background service to monitor the health of the app internet connection.
* It'll set a variable to tell any other controller what's going on with the current connection.
* 1 = Everything's good.
* 2 = Poor connectivity, but still have a connection.
* 3 = We have internet, but are having problems with the API.
* 4 = No internet.
*/
function appConnectionHealth() {
@shouse
shouse / README.md
Last active October 28, 2017 21:23
Ti.Geohash: Encoding/decoding and associated functions

geohash

Functions to convert a geohash to/from a latitude/longitude point, and to determine bounds of a geohash cell and find neighbours of a geohash.

Methods summary:

  • encode: latitude/longitude point to geohash
  • decode: geohash to latitude/longitude