Skip to content

Instantly share code, notes, and snippets.

View shouse's full-sized avatar

Steven shouse

  • SIVCI
  • Kansas City, MO
View GitHub Profile
@olih
olih / jq-cheetsheet.md
Last active June 25, 2025 09:28
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@kimmobrunfeldt
kimmobrunfeldt / monkey-patch-console.js
Created April 4, 2016 11:16
Monkey patching console log
console.warn('- console.(debug|info|log|warn|error) monkey-patched');
const methods = ['debug', 'info', 'log', 'warn', 'error'];
// We have to take the direct references to the actual function like this
// instead of doing just: originalConsole = console
const originalConsole = _.reduce(methods, (memo, methodName) => {
memo[methodName] = _.bind(console[methodName], console);
return memo;
}, {});
/**
* Ti.TouchID
*
* Summary: Support native Touch ID with Hyperloop in Titanium Mobile.
* Author: Hans Knoechel | Appcelerator, Inc
* Date: 03/22/2016
* Version: 0.1.0
* Example
*
* var touchID = require("ti.touchid");
@Integralist
Integralist / 1. linux utilities.md
Last active March 30, 2025 08:07
Different Linux utility commands (e.g. top, ps, strace, lsof, netstat, ifconfig, iftop, iptraf, tcpdump, wireshark)

Start up a container (whichever Linux flavour takes your fancy):

docker run -it ubuntu /bin/bash
docker run -it centos /bin/bash
  • top: check what CPU and Memory running processes are utilising
  • ps: see what processes are running
  • strace: monitor interactions between processes
/**
* HYPERLOOP GENERATED - DO NOT MODIFY
*
* This source code is Copyright (c) 2016 by Appcelerator, Inc.
* All Rights Reserved. This code contains patents and/or patents pending.
*/
var $dispatch = Hyperloop.dispatch,
$init,
$imports,
$class;
@subfuzion
subfuzion / curl.md
Last active June 30, 2025 21:36
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@benbahrenburg
benbahrenburg / app.js
Last active February 6, 2018 09:46
Titanium Settings Dialog Examples
Ti.UI.setBackgroundColor('#000');
var alertSettings = require("settings-dialog");
var win = Ti.UI.createWindow({
title:'Example', backgroundColor:'#fff', layout:"vertical"
});
win.add(Ti.UI.createLabel({
text:"Example on now to prompt user to change settings",

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)
@Topener
Topener / index.js
Last active June 13, 2019 06:53
Simple example how to work with collections data-binding in Alloy, including filter, sorting, data transform and manual refresh
$.Departures.comparator = sortDepartures;
$.Departures.reset([]);
var sortByName = true;
function transformDeparture(model){
if (!model || !model.get('destination')){
console.warn(model.toJSON());
}
var time = require('Date').formatTime(model.get('time'));
@grantges
grantges / Readme.md
Last active October 31, 2020 20:13
Shapes With Appcelerator Titanium and Hyperloop

Custom Alloy Tags based on Appcelerator Hyperloop modules

With Alloy and Hyperloop, you can quickly and easily expose native UI as Custom Alloy tags by leveraging the namespace (ns) attribute and commonjs modules.

Alloy allows you to create your own UI element that can be included into the XML View heirarchy in one of two ways, an Alloy Widget or through the use of Custom Tags.

To create your own custom tag, you link the tag to the commonjs module with the namespace attribute (ns). Here is an example using a custom tag to render a standard Titanium View: