Skip to content

Instantly share code, notes, and snippets.

View kamiro's full-sized avatar

Gary Morrison kamiro

View GitHub Profile
@kamiro
kamiro / erlang-elixir-on-amazon-linux.md
Created July 26, 2017 21:20 — forked from techgaun/erlang-elixir-on-amazon-linux.md
Running elixir 1.4 on amazon linux

pre-install

yum install ncurses-devel openssl-devel

install erlang

yum groupinstall "Development Tools"
wget "http://erlang.org/download/otp_src_19.3.tar.gz" -O otp19.tar.gz
tar xfz otp19.tar.gz
cd otp_src_19.3/
./configure

make && make install

Keybase proof

I hereby claim:

  • I am kamiro on github.
  • I am kamiro (https://keybase.io/kamiro) on keybase.
  • I have a public key whose fingerprint is D7CF 99B1 E684 523B 1E0B 01DC 2AE3 6A5B 08AC 15A2

To claim this, I am signing this object:

@kamiro
kamiro / Makefile
Last active August 29, 2015 14:27 — forked from bewest/Makefile
medtronic symbol table
CC=gcc
CFLAGS=-lm -pthread
rtl_mmpump: rtl_mmpump.c
# xxx: gcc ./rtl_mmpump.c -pthread -lm $(pkg-config --libs --cflags libusb-1.0 librtlsdr)
$(CC) -o $@ $< $(CFLAGS) $(shell pkg-config --libs --cflags libusb-1.0 librtlsdr)
all: rtl_mmpump

Branches

list branches
git branch [-a to include remote branches]

create branch [from master]
git checkout -b HS-1234 [master]

update master, rebase and push
git checkout master

#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
#pragma mark -
#pragma mark CGFloat
#pragma mark Trigonometric Functions
#define CGFloatCos(a) (CGFLOAT_IS_DOUBLE ? cos(a) : cosf(a))
#define CGFloatSin(a) (CGFLOAT_IS_DOUBLE ? sin(a) : sinf(a))
#define CGFloatTan(a) (CGFLOAT_IS_DOUBLE ? tan(a) : tanf(a))
#define CGFloatACos(a) (CGFLOAT_IS_DOUBLE ? acos(a) : acosf(a))
#define CGFloatASin(a) (CGFLOAT_IS_DOUBLE ? asin(a) : asinf(a))
#define CGFloatATan(a) (CGFLOAT_IS_DOUBLE ? atan(a) : atanf(a))
@kamiro
kamiro / Encbox.md
Created July 21, 2013 22:16 — forked from Tho85/Encbox.md

Build your own private, encrypted, open-source Dropbox-esque sync folder

Prerequisites:

  • One or more clients running a UNIX-like OS. Examples are given for Ubuntu 12.04 LTS, although all software components are available for other platforms as well (e.g. OS X). YMMV
  • A cheap Ubuntu 12.04 VPS with storage. I recommend Backupsy, they offer 250GB storage for $5/month. Ask Google for coupon codes.

Software components used:

  • Unison for file synchronization
  • EncFS for folder encryption
@kamiro
kamiro / gist:4504491
Last active December 10, 2015 22:48
Git pre-commit hook with color diff support
#!/bin/sh
# git pre-commit hook that runs an Uncrustify stylecheck.
# Features:
# - abort commit when commit does not comply with the style guidelines
# - create a patch of the proposed style changes
#
# More info on Uncrustify: http://uncrustify.sourceforge.net/
# This file is part of a set of unofficial pre-commit hooks available
@kamiro
kamiro / Objective C Uncrustify
Last active December 10, 2015 21:58
This is the current objective C uncrustify script
indent_align_string=false
indent_braces=false
indent_braces_no_func=false
indent_brace_parent=false
indent_namespace=false
indent_extern=false
indent_class=false
indent_class_colon=false
indent_else_if=false
indent_columns=4
@kamiro
kamiro / gist:3902122
Created October 16, 2012 21:21 — forked from rsattar/gist:1896546
RegexKitLite's arrayOfCaptureComponentsMatchedByRegex: written using NSRegularExpression
// I had a need to replace the use of RegexKitLite's arrayOfCaptureComponentsMatchedByRegex with
// the built-in NSRegularExpression in iOS 5+, and didn't find an existing example, so I wrote one:
- (NSArray *) arrayOfCaptureComponentsOfString:(NSString *)data matchedByRegex:(NSString *)regex
{
NSError *error = NULL;
NSRegularExpression *regExpression = [NSRegularExpression regularExpressionWithPattern:regex options:NSRegularExpressionCaseInsensitive error:&error];
NSMutableArray *test = [NSMutableArray array];