This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# File: ./Makefile.gitlab | |
# Usage: make -f Makefile.gitlab | |
# NOTE: Assumes Debian 9 OS | |
MAKEFLAGS += --silent | |
define K8S_METALLB_CMD | |
cat <<EOF | kubectl apply -f - | |
apiVersion: v1 | |
kind: ConfigMap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* flatten an array of integers | |
* @param arr {Array} - An array of integers to flatten | |
* @return {Array} - A flattened array of integers | |
*/ | |
function flatten(arr) { | |
return arr.reduce((res, _arr) => { | |
// typecast to array if not already (for next step) | |
// otherwise, ensure provided array is flat | |
_arr = Array.isArray(_arr) ? flatten(_arr) : [_arr]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Run on raspberry pi | |
# source: https://github.com/diginc/docker-pi-hole | |
IP_LOOKUP="$(ip route get 8.8.8.8 | awk '{ print $NF; exit }')" # May not work for VPN / tun0 | |
IPv6_LOOKUP="$(ip -6 route get 2001:4860:4860::8888 | awk '{ print $10; exit }')" # May not work for VPN / tun0 | |
IP="${IP:-$IP_LOOKUP}" # use $IP, if set, otherwise IP_LOOKUP | |
IPv6="${IPv6:-$IPv6_LOOKUP}" # use $IPv6, if set, otherwise IP_LOOKUP | |
DOCKER_CONFIGS="$(pwd)" # Default of directory you run this from, update to where ever. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PUBLIC_IP=$(curl -s ipecho.net/plain) | |
COUNTRY="US" | |
PROVINCE="California" | |
CITY="San Francisco" | |
ORG="Copyleft Certificate Co" | |
EMAIL="[email protected]" | |
OU="My Organizational Unit" | |
CN="." | |
CLIENT_NAME="client1" | |
PORT=1194 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SDK_URL=http://dl.nwjs.io/v0.14.4/nwjs-sdk-v0.14.4-osx-x64.zip | |
export SDK_URL | |
APP_BIN=Signal.app | |
export APP_BIN | |
PROJECT=Signal-Desktop | |
export PROJECT | |
GIT_URL=https://github.com/WhisperSystems/${PROJECT}.git | |
export GIT_URL | |
fetch: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# script insstalls qemu and vagrant, then uses vagrant to build a qemu- | |
# supported rpi kernel for dev. | |
# - tested with 2015-02-16-raspbian-wheezy.zip on OSX El Capitan | |
# Variables | |
IMAGE=http://downloads.raspberrypi.org/raspbian_latest | |
IMG_PATH="/vagrant/raspbian_latest.img" | |
PI_LINUX=https://github.com/raspberrypi/linux | |
PI_LINUX_BRANCH="rpi-4.2.y" | |
PI_TOOLS=https://github.com/raspberrypi/tools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pulled from http://xecdesign.com/qemu-emulating-raspberry-pi-the-easy-way/ | |
# expanded via http://superuser.com/questions/690060/how-to-enable-network-with-a-raspberry-pi-emulated-on-qemu | |
# tested with 2015-02-16-raspbian-wheezy.zip on OSX Mavericks | |
# OSX terminal | |
brew install qemu | |
# kernel-qemu is a linux kernel compiled with ARM1176 support. | |
# learn more here: http://xecdesign.com/compiling-a-kernel/ | |
curl -OL http://xecdesign.com/downloads/linux-qemu/kernel-qemu | |
curl -o raspbian_latest.zip -L http://downloads.raspberrypi.org/raspbian_latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
siteshot: function (email, done) { | |
var oses = {'ios': [], 'Windows': [], 'OS X': [], 'other': []}; | |
var successes = oses; | |
var browsers = require(process.cwd() + '/meta/browsers.js'); | |
var settings = { url: 'http://example.com/' }; | |
async.mapSeries(browsers, function (browser, shotDone) { | |
settings.browsers = [browser]; | |
request({ | |
url: 'http://www.browserstack.com/screenshots', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('input[name="screenshots"]').val('http://staging.storydesk.com/case-studies/pharma'); | |
$('.sel').removeClass('sel'); | |
//Non-windows devices | |
var devices = ['iPad 2 (5.0)','iPad 3rd','iPad 3rd (6.0)','iPhone 5','iPad Mini','LG Nexus 4','Google Nexus 7']; | |
for(var i in devices) { | |
$('a[device="'+devices[i]+'"]').addClass('sel'); | |
} | |
//Windows OSes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function maxArea (original, histogram, maxArray) { | |
if (!histogram) { | |
histogram = original.slice(0); | |
} | |
maxArray = maxArray || new Array(histogram.length); | |
var currVal = histogram.pop(); | |
if (currVal===0 || !histogram.length) { | |
maxArray[histogram.length] = currVal; |
NewerOlder