Skip to content

Instantly share code, notes, and snippets.

@tabrindle
tabrindle / gist:1074d34897859cee78b9778742b84c14
Last active May 22, 2017 21:27
install using sdkmanager instead of android
#!/bin/bash
for target in "platforms;android-23" \
"platforms;android-25" \
"build-tools;25.0.3" \
"build-tools;23.0.1" \
"extras;google;m2repository" \
"extras;android;m2repository" \
"extras;google;google_play_services"; do
echo "Update/install: " $target
@tabrindle
tabrindle / gist:fb8524498ffc6f9933232a6842b28868
Created February 28, 2017 19:30
flatten array function
const flatten = arr => arr.reduce((a, b) => a.concat(Array.isArray(b) ? flatten(b) : b), []);
@tabrindle
tabrindle / symlink_recent.sh
Created November 16, 2016 16:16
Create symlink to most recent directory
@tabrindle
tabrindle / gist:574bfddccdae39965b86305fb7ce2003
Last active October 19, 2016 14:16
excel sheet index conversion
// minified
a=>a.toUpperCase().split('').reduce((b,c)=>b*26+c.charCodeAt(0)-"A".charCodeAt(0)-1,0)
// one-lined
column => column.toUpperCase().split('').reduce((acc,val) => acc * 26 + val.charCodeAt(0) - "A".charCodeAt(0) - 1,0);
// expanded
function convert_column_to_index(column_name) {
return column_name.split('').reduce(function(acc,val) {
return acc * 26 + val.charCodeAt(0) - ("A".charCodeAt(0) - 1)
@tabrindle
tabrindle / gist:26d69862c70b82ea255d09ae3dd4b934
Created July 18, 2016 01:51
Convert directory files to FLAC, then create a .m3u
for FILE in *; do flac -8 $FILE; done;
for FILE in *; do echo "$FILE" >> "${PWD##*/}".m3u; done;
find ~/.gradle -type f -name "*.lock" | while read f; do rm $f; done
@tabrindle
tabrindle / get-ios-certs.rb
Created June 23, 2016 13:18
Get all ios certs from developer portal
#!/usr/bin/env ruby
require 'spaceship'
Spaceship.login('mobile@marketamerica.com')
Spaceship.select_team
Spaceship.certificate.all.each do |cert|
cert_type = Spaceship::Portal::Certificate::CERTIFICATE_TYPE_IDS[cert.type_display_id].to_s.split("::")[-1]
puts "Cert id: #{cert.id}, name: #{cert.name}, expires: #{cert.expires.strftime("%Y-%m-%d")}, type: #{cert_type}"
@tabrindle
tabrindle / index.jade
Created June 20, 2016 18:34
nmx-banner-test
.banner
.banner_container
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/159363/banner-product.png")
div
h1 Make This Your<br><span>BEST YEAR</span>
h2 NutraMetrix Prime Astaxanthin
button Learn More
# couchbase on docker
- install docker toolbox - `brew cask install dockertoolbox`
- create default vm - `docker-machine create --driver virtualbox default`
- get machines defaults - `docker-machine env default`
- save defaults to shell - `eval "$(docker-machine env default)"`
- install and run docker container - `docker run -d -p 8091:8091 --name cb couchbase:community`
- go to http://192.168.99.100:8091
@tabrindle
tabrindle / gist:b9c1201d8fbaed161e21242e92ee592b
Created June 3, 2016 16:30
Remove all cordova plugins from bash
cordova plugins | cut -d ' ' -f1 | xargs cordova plugin rm