start new:
tmux
start new with session name:
tmux new -s myname
var mcapi = require('./node_modules/mailchimp-api/mailchimp'); | |
var usersRef = db.ref('users'); | |
var mc = new mcapi.Mailchimp('xxxxxxxxxx-api-key-us4'); | |
usersRef.orderByChild('added_to_mailchimp').equalTo(null).on('child_added',function(snapshot){ | |
var user = snapshot.val(); | |
var key = snapshot.key; | |
if(user && user.email){ | |
var listId = 'xxxx-list-id-xxxx'; | |
var name = user.displayName || ''; |
/* Basscss Type Scale */ | |
.h1 { font-size: var(--h1) } | |
.h2 { font-size: var(--h2) } | |
.h3 { font-size: var(--h3) } | |
.h4 { font-size: var(--h4) } | |
.h5 { font-size: var(--h5) } | |
.h6 { font-size: var(--h6) } | |
:root { |
// Bubble sort | |
// Time: O(n^2) | |
// Space: O(1) | |
const test = require('assert').deepEqual | |
const bubbleSort = (arr) => { | |
// Create a variable to store values temporarily - Only needs to be created once for O(1) space complexity | |
let temp = null | |
// Quicksort | |
// Time: O(n log(n)) | |
// Space: O(log(n)) | |
const test = require('assert').deepEqual | |
const quickSort = (arr) => { | |
if (arr.length <= 1) return arr | |
const pivotIndex = arr.length - 1 |
TP_ANSI_RESET "\x1b[0m" | |
TP_ANSI_BOLD_ON "\x1b[1m" | |
TP_ANSI_INVERSE_ON "\x1b[7m" | |
TP_ANSI_BOLD_OFF "\x1b[22m" | |
TP_ANSI_FG_BLACK "\x1b[30m" | |
TP_ANSI_FG_RED "\x1b[31m" | |
TP_ANSI_FG_GREEN "\x1b[32m" | |
TP_ANSI_FG_YELLOW "\x1b[33m" | |
TP_ANSI_FG_BLUE "\x1b[34m" | |
TP_ANSI_FG_MAGENTA "\x1b[35m" |
var string = [email protected] | |
string.match(/^(\w|\+|\d|\-|\.)+\@(\w|\d|\-)+\.(\w|\.)+$/i) |
Split vertically: <Ctrl-b>% | |
Split horizontally: <Ctrl-b>" | |
Move around panes: <Ctrl-b>[Up, Down, Right, Left] | |
Previous pane: <Ctrl-b>; | |
Rotate panes: <Ctrl-b><Ctrl-o> | |
Resize: <Ctrl-b>:resize-pane -U[D,L,R] 10 | |
Close pane: <Ctrl-b>x |
This will delete branches that have already been merged. Good for cleaning up local repos. Wont delete your current branch.
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
Saved here for my own reference but all credit to this guy: http://stevenharman.net/git-clean-delete-already-merged-branches
WARNING: This will only spare your current branch. Remember that you might lose master/staging/etc if you're not currently on that branch.