Skip to content

Instantly share code, notes, and snippets.

Steve steverichey

Block or report user

Report or block steverichey

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@steverichey
steverichey / zipify.sh
Created Jul 17, 2017
this is just a good script with things i might want later
View zipify.sh
#!/bin/sh
set -eu
ZIP_FILENAME="experience.zip"
JS_FILENAME="template.js"
WTC_FILENAME="tracker.wtc"
DATENAME=`date +"%Y-%m-%d-%H%M%S"`
OUTPUT_JS_DIR="scripts"
OUTPUT_WTC_DIR="augmentation-trackers/4.1"
@steverichey
steverichey / trim_screen.sh
Created Mar 15, 2017
chop up an Android screenshot real nice
View trim_screen.sh
#!/bin/sh
filename="${1%.*}"
convert $1 -gravity North -chop 0x72 ${filename}-trimmed.png
convert ${filename}-trimmed.png -gravity South -chop 0x96 ${filename}-trimmed-both.png
@steverichey
steverichey / eject_trash_images.py
Last active Dec 28, 2016
Python script used in Automator workflow to eject trashed images
View eject_trash_images.py
# Python script to eject disk images passed as args
# Create a new Folder Action in Automator and add a Run Shell Script step
# Set the shell to /usr/bin/python *AND* set "Pass input:" to "as arguments"
# Paste this script and save! Images moved to the trash are now auto-ejected
# Mostly based on http://www.guidingtech.com/26874/eject-delete-dmg-files-automatically/
import os, sys
# Bail if we didn't wipe a DMG
View keybase.md

Keybase proof

I hereby claim:

  • I am steverichey on github.
  • I am steverichey (https://keybase.io/steverichey) on keybase.
  • I have a public key whose fingerprint is 516B 6908 5CE8 D147 B985 5E42 9011 2DDB F6AB F744

To claim this, I am signing this object:

@steverichey
steverichey / keep-adb-running.sh
Last active Nov 28, 2018 — forked from mauron85/keep-adb-running.sh
Workaround adb disconnecting issue on macOS Sierra
View keep-adb-running.sh
#!/bin/bash
cat << EOF
###########################################################
# Workaround adb disconnecting issue on macOS Sierra
#
# More info:
# https://code.google.com/p/android/issues/detail?id=219085
# credits to: hans...@meetme.com, vs...@google.com
###########################################################
@steverichey
steverichey / egg.py
Created Aug 8, 2016
Automatic egg hatcher for Egg, Inc.
View egg.py
# Save as `egg.py`
# Run with `monkeyrunner egg.py`
# Must have Android SDK `tools` directory in your PATH
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice, MonkeyView
device = MonkeyRunner.waitForConnection()
# These will vary depending on your device!
x = 720
@steverichey
steverichey / csv_to_bitmap.swift
Created Jun 28, 2016
Convert CSV of luminance to PNG
View csv_to_bitmap.swift
// swiftlint:disable line_length
// swiftlint:disable variable_name
import Foundation
import Cocoa
struct PixelData {
var a: UInt8 = 255
var r: UInt8
var g: UInt8
@steverichey
steverichey / install_cuda.sh
Created Jun 15, 2016
CUDA ARM Setup (Ubuntu 14.04)
View install_cuda.sh
# install CUDA
sudo apt-get update
wget "http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_7.5-18_amd64.deb"
sudo dpkg -i cuda-repo-ubuntu1404_7.5-18_amd64.deb
sudo apt-get update
sudo apt-get install cuda -y
export PATH=/usr/local/cuda-7.5/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:$LD_LIBRARY_PATH
# install MPI (optional, for some samples)
@steverichey
steverichey / SequenceType+Multifilter.swift
Created Apr 21, 2016
A Swift extension to perform two filters simultaneously.
View SequenceType+Multifilter.swift
extension SequenceType {
/**
Filter a single sequence into two "buckets", each an array containing objects of this collection's element type.
- parameter includeElementInFirstCollection: A method that returns true for elements to include in the first collection.
- parameter includeElementInSecondCollection: A method that returns true for elements to include in the second collection.
- returns: A tuple of two arrays containing the elements in their respective buckets.
*/
@warn_unused_result
public func multifilter(@noescape includeInFirst includeElementInFirstCollection: (Self.Generator.Element) throws -> Bool, @noescape includeInSecond includeElementInSecondCollection: (Self.Generator.Element) throws -> Bool) rethrows -> ([Self.Generator.Element], [Self.Generator.Element]) {
var firstCollection: [Self.Generator.Element] = []
@steverichey
steverichey / NeuralPlayground.swift
Created Mar 17, 2016
NeuralSwift - A very simple neural network written in Swift.
View NeuralPlayground.swift
// see http://lumiverse.io/series/neural-networks-demystified
import Foundation
let startTime = NSDate()
defer {
let endTime = NSDate()
print("Total time \(endTime.timeIntervalSinceDate(startTime))")
}
You can’t perform that action at this time.