Skip to content

Instantly share code, notes, and snippets.

View shouse's full-sized avatar

Steven shouse

  • SIVCI
  • Kansas City, MO
View GitHub Profile
@shouse
shouse / osascript.rb
Created September 24, 2018 18:04 — forked from jpalumickas/osascript.rb
Osascript examples
# === Terminal.app === #
# Open new tab in terminal.
exec("osascript -e 'tell application \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down' > /dev/null 2>&1 ")
# Open directory
exec("osascript -e 'tell application \"Terminal\" to do script \"cd directory\" in selected tab of the front window' > /dev/null 2>&1 ")
# Open directory in new tab (this is better)
exec("osascript -e 'tell application \"Terminal\"' -e 'tell application \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down' -e 'do script with command \"cd directory && clear\" in selected tab of the front window' -e 'end tell' > /dev/null 2>&1")
@shouse
shouse / 1. linux utilities.md
Created September 20, 2018 04:33 — forked from Integralist/1. linux utilities.md
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

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

/**
* 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");
var FBSDKShareLinkContent = require("FBSDKShareKit/FBSDKShareLinkContent"),
FBSDKShareDialog = require("FBSDKShareKit/FBSDKShareDialog"),
NSURL = require("Foundation/NSURL");
var win = Ti.UI.createWindow({
backgroundColor: "#fff"
});
var btn = Ti.UI.createButton({
title: "Trigger Share Dialog"
var Button = require("android.widget.Button"),
LayoutParams = require('android.widget.FrameLayout.LayoutParams'),
Activity = require('android.app.Activity'),
Color = require('android.graphics.Color'),
TypedValue = require('android.util.TypedValue'),
Gravity = require('android.view.Gravity'),
OnClickListener = require('android.view.View.OnClickListener'),
currentActivity = new Activity(Ti.Android.currentActivity);
// Create a new Button object with your current activity
@shouse
shouse / charts.js
Created November 13, 2017 18:17 — forked from grantges/charts.js
Hyperloop Donut Example using Alloy Custom Tags (charts.js should be put in the app/lib folder of your app)
var Hyperloop = require('hyperloop');
var UIView = require('UIView');
var CGRect = require('CGRect');
var CGPoint = require('CGPoint');
var UIColor = require('UIColor');
var UIBezierPath = require('UIBezierPath');
function DEGREES_TO_RADIANS(angle) { return (Number(angle) / 180.0 * Math.PI) };
@shouse
shouse / index.js
Created November 13, 2017 16:37
Speech Recognition using Appcelerator Titanium and Hyperloop
'use strict';
/**
* Android sample showing speech recognition using Hyperloop.
*
* @version Titanium 6.1.2.GA
* @version Alloy 1.9.13
* @version Hyperloop 2.1.3
*/
@shouse
shouse / avaudioplayer.js
Created November 13, 2017 15:56 — forked from hansemannn/avaudioplayer.js
Use the AVAudioPlayer with Hyperloop.
var AVAudioEngine = require('AVFoundation/AVAudioEngine');
var AVAudioPlayerNode = require('AVFoundation/AVAudioPlayerNode');
var AVAudioFile = require('AVFoundation/AVAudioFile');
var NSBundle = require('Foundation/NSBundle');
var win = Ti.UI.createWindow({
backgroundColor: '#fff'
});
var btn = Ti.UI.createButton({