Skip to content

Instantly share code, notes, and snippets.

View amorphid's full-sized avatar

Michael Pope amorphid

  • Digital Turbine
  • San Francisco, CA
View GitHub Profile
# Android
export ANDROID_HOME="/Users/mikepope/Applications/android-sdk-macosx"
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home"
@amorphid
amorphid / gist:25f24bf10abc3c16c6a2
Created September 11, 2015 00:43
hey look, a public gist
woot!
@amorphid
amorphid / elixir_setup.md
Created November 28, 2015 19:37
Setting up Elixir 1.1.1 on Mac OS 10.10.5

Setting up Elixir 1.1.1 on Mac OS 10.10.5

These are the steps I used to install Elixir on a Macbook Pro on Nov. 28, 2015.

If you find this Gist, and would like help setting up Elixir, feel free to email me at [email protected].

Prerequisites

You'll need the following installed before setting up Elixir:

@amorphid
amorphid / computer_science_terms.txt
Last active February 1, 2016 14:48
Computer Science Terms
algotirhm:
- a set of steps (for a computer program) to accomplish a task
data structure:
- a way of organizing data that considers not only the items stored, but also their relationship to each other.
@amorphid
amorphid / counter.ex
Last active March 25, 2016 17:50
Elixir counter
defmodule Counter do
use GenServer
# Client
def decrement(pid) do
GenServer.call(pid, :decrement)
end
def count(pid) when is_pid(pid) do
@amorphid
amorphid / stack-simple-one-for-one.ex
Created August 12, 2016 06:08 — forked from tastywheat/stack-simple-one-for-one.ex
elixir supervised Stack using simple_one_for_one strategy
# iex(80)> {:ok, _} = Test_1.start_child(:foo)
# {:ok, #PID<0.1214.0>}
# iex(81)> Stack.push(:foo, :hello)
# :ok
# iex(82)> Stack.push(:foo, :hello)
# :ok
# iex(83)> Stack.pop(:foo)
# :hello
# iex(84)> Stack.pop(:foo)
# :hello
@amorphid
amorphid / uuid.sh
Created September 15, 2016 00:45
Bash UUID
#!/bin/bash
# Couldn't find a pure Bash utility for UUIDs, so I wrote this for fun (it ain't fast)
base_36_char () {
(
HIGH=${1:-15}
LOW=${2:-0}
RAND_NUM=$RANDOM
@amorphid
amorphid / 0_reuse_code.js
Created December 15, 2016 22:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@amorphid
amorphid / osx_ramdisk.sh
Created March 11, 2017 00:00 — forked from jnschulze/osx_ramdisk.sh
Move Chrome, Safari and iTunes Cache to Ramdisk.
#!/bin/bash
# Size at the end is * 2048 where 2048 = 1 MB, so 1572864 = 768 MB
#DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://1572864`
DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://2097152`
/usr/sbin/diskutil erasevolume HFS+ "RamDiskCache" $DISK
CACHEDIR="/Volumes/RamDiskCache/$USER"
@amorphid
amorphid / example.cpp
Last active November 2, 2017 21:58
C++ addition precision
#include <iostream>
#include <iomanip>
using namespace std;
int main () {
double a = 0.1;
double b = 0.2;
double result = a + b;