Skip to content

Instantly share code, notes, and snippets.

View arronmabrey's full-sized avatar

Arron Mabrey arronmabrey

View GitHub Profile
@arronmabrey
arronmabrey / spacemacs-git-gutter-with-linum.el
Last active May 10, 2019 07:51
Config git-gutter with linum in Spacemacs
(defun dotspacemacs/layers ()
(setq-default
dotspacemacs-configuration-layers
'((version-control :variables
version-control-global-margin t
version-control-diff-tool 'git-gutter
))))
(defun dotspacemacs/init ()
@arronmabrey
arronmabrey / ios-type2phone-cli.swift
Created September 16, 2016 16:11
ios-type2phone-cli.swift
#!/usr/bin/env swift
import Foundation
print("Enter keycode to send: ", terminator: "")
if let keycode = readLine() {
print("set keycode = \(keycode)")
@arronmabrey
arronmabrey / rbenv-install-system-wide.sh
Created April 18, 2017 21:26 — forked from endersonmaia/rbenv-install-system-wide.sh
rbenv install and system wide install on Ubuntu 12.04
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
function getBase64Image(img) {
var canvas = document.createElement("canvas");
canvas.width = img.width;
canvas.height = img.height;
var ctx = canvas.getContext("2d");
ctx.drawImage(img, 0, 0);
var dataURL = canvas.toDataURL("image/png");
return dataURL.replace(/^data:image\/(png|jpg);base64,/, "");
}
var go = function(og) {
console.log("go")
var reader = new FileReader();
reader.addEventListener("load", function () {
console.log("reader load", reader.result)
completion(reader.result)
}, false);
fetch(og.src).then(function(req) {
console.log("fetch", req)
req.blob().then(function(data) {
@arronmabrey
arronmabrey / gitmerged
Last active February 23, 2022 04:48
Checks if feature branches have been merged/squashed/rebased into master
#!/usr/bin/env ruby
ENV["GIT_MERGE_AUTOEDIT"] = "no"
master_branch = "master"
merge_branch = "gitmerged-master"
`git fetch`
fail "uncommited changes" unless `git status --porcelain`.empty?
@arronmabrey
arronmabrey / eta.rb
Last active November 21, 2023 04:34
eta.rb
def eta mod, start_time, total_count, current_time, current_idx
current_count = current_idx + 1
if (current_idx % mod).zero? || current_count >= total_count
percent_done = ((current_count.to_f / total_count.to_f) * 100).round(2)
rem_count = total_count - current_count
run_sec = (current_time - start_time).to_i
avg_parse_time = run_sec.to_f / current_count.to_f
rem_sec = rem_count * avg_parse_time