Skip to content

Instantly share code, notes, and snippets.

View juniorbird's full-sized avatar

Wade Armstrong juniorbird

View GitHub Profile
[
{
"type": "escape",
"width": 64,
"align": "left"
},
{
"type": "illuminationDown",
"width": 40,
"align": "left",
@juniorbird
juniorbird / keybase.md
Created July 2, 2018 01:16
keybase.md

Keybase proof

I hereby claim:

  • I am juniorbird on github.
  • I am kaizendad (https://keybase.io/kaizendad) on keybase.
  • I have a public key ASDADvJ-ismCZ4K8ZJeHQhT1OBHQGk0Gf5nbVRy4SQFnAwo

To claim this, I am signing this object:

@juniorbird
juniorbird / memoize.js
Created April 24, 2018 01:23
Simple JS Memoize
let utils = {};
utils.memoize = function(fn) {
let cache = {};
return function(...args) {
let key = [...args].join(',');
if (cache[key]) return cache[key];
@juniorbird
juniorbird / firstrepeatingchar.js
Created April 24, 2018 00:39
Get First Repeating Character Example
function getFirstRepeatingCharacter(someString) {
let len = someString.length;
let cache = {};
for (let i = 0; i < len; i++) {
let currentLetter = someString.charAt(i);
if (cache[currentLetter]) return someString.charAt(i);
cache[currentLetter] = true;
}
@juniorbird
juniorbird / tmux.conf
Created July 18, 2017 18:25
My tmux.conf
setw -g mode-keys vi
# split panes using | and -
bind \ split-window -h -c "#{pane_current_path}"
bind - split-window -v
unbind '"'
unbind %
# require I name windows and sessions
bind-key S command-prompt -p "Name of new session: " "new-session -s '%%'"
@juniorbird
juniorbird / storieslist.js
Created May 30, 2017 20:54
Evernote Stories List Bookmarklet
let storiesList = prompt('Paste your comma-separated story list here');
let target = document.getElementById('en-note');
let storiesArr = storiesList.split(',').sort();
let nodes = storiesArr.map(story => makeEvernoteHeading(story));
nodes.forEach(node => {
target.appendChild(node);
target.appendChild(makeEvernoteSpacer());
@juniorbird
juniorbird / Embedit
Last active June 24, 2017 22:54
Taco customization with quote of the day
<iframe src="https://juniorbird.github.io/quotes-for-taco/" frameborder="0" width="100%"></iframe>
@juniorbird
juniorbird / portforward.sh
Created August 8, 2016 21:20
Forward Mac OS >= 10.10.x 8080 to 80
echo "
rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
rdr pass inet proto tcp from any to any port 443 -> 127.0.0.1 port 8443
" | sudo pfctl -ef -
@juniorbird
juniorbird / planner.scpt
Last active August 31, 2016 19:20
Simple applescript day planner
##############
# Time-related tasks
set plannerMonth to (month of (current date) as text)
set plannerDay to (day of (current date) as text)
set plannerYear to (year of (current date) as text)
################
# Set up our file paths
# Base paths
@juniorbird
juniorbird / compose.js
Last active June 21, 2016 23:02
Reducing and composing in Javascript
'use strict';
function sortedCal(calArray) {
return calArray.sort((a, b) => a[0] > b[0]);
}
function mergeRanges(sortedCal) {
let start;
let end;