Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am aosalias on github.
  • I am adamolsen (https://keybase.io/adamolsen) on keybase.
  • I have a public key whose fingerprint is B48C 6F37 A134 4B7D AD71 055F 870F 832F 8181 D4B8

To claim this, I am signing this object:

@aosalias
aosalias / .gitconfig
Last active July 17, 2017 16:29
git aliases
[alias]
co = checkout
com = checkout master
ci = commit
cim = commit --amend
wip = !git add . && git ci -m 'wip'
cp = cherry-pick
cpc = cherry-pick --continue
@aosalias
aosalias / myBind.js
Created November 8, 2016 19:44
Interview Question for JS fundamentals
function myBind() {
var args = Array.slice(arguments);
var func = arguments.pop()
var that = arguments.pop()
return ;
}
// currying
var add = function(...) { return x + y; }
@aosalias
aosalias / .gitconfig
Created November 7, 2016 16:44
Git Dot File
[alias]
co = checkout
ci = commit
cim = commit --amend
cp = cherry-pick
cpc = cherry-pick --continue
st = status
[alias]
co = checkout
ci = commit
cim = commit --amend
cp = cherry-pick
cpc = cherry-pick --continue
st = status
@aosalias
aosalias / schnucks_location_scraper.rb
Created May 12, 2016 23:27
Scrape store info from schnucks website
require 'mechanize'
require 'CSV'
require 'byebug'
robot = Mechanize.new
schnucks = robot.get 'http://www.schnucks.com/stores/'
CSV.open('./schnucks_data.csv', 'wb') do |csv|
csv << %w(Name Street City State Zip Phone ID)
@aosalias
aosalias / javascript_svg_download.js
Created April 14, 2016 17:32
Create a download link for an svg client side (Like one drawn from D3.js) (Excuse the jQuery, this could easily be done in raw js)
$('.container svg').attr({
'xmlns': 'http://www.w3.org/2000/svg',
'xmlns:xlink': "http://www.w3.org/1999/xlink"
});
var base64SvgText = btoa(
encodeURIComponent(
$('.container').html()
).replace(/%([0-9A-F]{2})/g,
function (match, p1) {
require 'mechanize'
class Job
attr_accessor :title, :location
def initialize(title:, location:)
@title = title
@location = location
end
@aosalias
aosalias / logo-svg.html
Created January 25, 2016 23:17
Apcera logo light and dark background - styled in css
<html>
<style>
.logo {
/* Aspect ration ~ 1:6 */
height: 28px;
width: 165px;
margin: 15px;
}
.logo path.transparent {
@aosalias
aosalias / gist:19f9810d476c38756727
Created January 6, 2015 21:31
Time diff to human readable - Javascript
function formatTimeDiff(diff) {
var signifcants = 2,
human = '',
current,
times = [['year', 31536000],
['month', 2628000],
['week', 606461],
['day', 86400],
['hour', 3600],
['minute', 60],