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 / Iconizer.sh
Last active Feb 10, 2020
Create iOS application icons from one PDF file. Requires ImageMagick.
View Iconizer.sh
#!/bin/sh
#
# Iconizer shell script by Steve Richey (srichey@floatlearning.com)
#
# This is a simple tool to generate all necessary app icon sizes and the JSON file for an *EXISTING* Xcode project from one file.
# To use: specify the path to your vector graphic (PDF format) and the path to your Xcode folder containing Images.xcassets
# Example: sh iconizer.sh MyVectorGraphic.pdf MyXcodeProject
#
# Requires ImageMagick: http://www.imagemagick.org/
@steverichey
steverichey / pw
Created Oct 25, 2019
Simple password generator, version 2
View pw
#!/usr/bin/env sh
set -eur
generate()
{
allowed_characters="${1}"
number_of_characters="${2}"
cat /dev/random | env LC_CTYPE=C tr -cd "${allowed_characters}" | head -c "${number_of_characters}"
}
@steverichey
steverichey / imagenet_labels.txt
Created Mar 29, 2019
Just the ImageNet labels used by ResNet.
View imagenet_labels.txt
tench
goldfish
great_white_shark
tiger_shark
hammerhead
electric_ray
stingray
cock
hen
ostrich
@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 / pw
Created Nov 21, 2018
Password generation script
View pw
#!/bin/sh
set -e
# generate allowed_characters number_of_characters
generate()
{
cat /dev/random | env LC_CTYPE=C tr -cd $1 | head -c $2
}
@steverichey
steverichey / xoshiroPRNG.swift
Created Nov 21, 2018
Not thoroughly tested, needs update for some Random changes in Swift
View xoshiroPRNG.swift
import Foundation
// http://xoshiro.di.unimi.it/xoshiro256starstar.c
protocol PseudoRandomNumberGenerator {
associatedtype ReturnValue
mutating func next() -> ReturnValue
}
struct Arc4Random: PseudoRandomNumberGenerator {
@steverichey
steverichey / DontMovePreloader
Created Dec 18, 2013
Custom Preloader for HaxeFlixel, used in Don't Move
View DontMovePreloader
package;
import flash.Lib;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flixel.system.FlxPreloader;
import flash.events.Event;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
@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)
View genie.swift
//: Playground - noun: a place where people can play
import Cocoa
let caseLookup: [Character: Character] = [
"a": "A", "b": "B", "c": "C", "d": "D", "e": "E", "f": "F", "g": "G", "h": "H", "i": "I", "j": "J", "k": "K", "l": "L", "m": "M", "n": "N",
"o": "O", "p": "P", "q": "Q", "r": "R", "s": "S", "t": "T", "u": "U", "v": "V", "w": "W", "x": "X", "y": "Y", "z": "Z"
]
extension Dictionary where Value: Equatable {
@steverichey
steverichey / allow_ios_firewall.sh
Created Jul 30, 2018
In theory, allows the iOS simulator to bypass the firewall. May no longer be needed, or it works so well I no longer get the dialog prompt.
View allow_ios_firewall.sh
#!/bin/sh
# requires sudo
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
/usr/libexec/ApplicationFirewall/socketfilterfw --add /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on
You can’t perform that action at this time.