Tested in Mac OS X: super == command
Open/Goto
- super+t: go to file
- super+ctrl+p: go to project
- super+r: go to methods
| /* The API controller | |
| Exports 3 methods: | |
| * post - Creates a new thread | |
| * list - Returns a list of threads | |
| * show - Displays a thread and its posts | |
| */ | |
| var Thread = require('../models/thread.js'); | |
| var Post = require('../models/post.js'); |
| mkdir temp | |
| cd temp | |
| git clone [email protected]:yourDomain/yourRepoName.git | |
| cd yourRepoName/ | |
| git remote rm origin | |
| git remote add origin https://[email protected]/yourUsername/yourNewRepoName.git | |
| git remote show origin | |
| git push origin master | |
| cd ../.. | |
| rm -rf temp |
| // When.js | |
| // TJ Eastmond <[email protected]>, SpiteShow | |
| // Simple Underscore.js Mixin that runs the first function until | |
| // it returns true, then runs the second | |
| (function() { | |
| // Pass in two functions. The first is checked until it returns true, then the second is run | |
| var when = function(truthy, func) { | |
| // Just making sure we were passed functions... |
| #/bin/bash | |
| #-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password | |
| REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'` | |
| if [ -z "$REPO_URL" ]; then | |
| echo "-- ERROR: Could not identify Repo url." | |
| echo " It is possible this repo is already using SSH instead of HTTPS." | |
| exit | |
| fi |
| import scala.util.Random | |
| import java.security.SecureRandom | |
| import java.util.concurrent.atomic.AtomicLong | |
| import org.joda.time.DateTimeUtils | |
| /** | |
| * 64 bit unique id generator | |
| * Features: | |
| * 1. generate ascending or descending ids | |
| * 2. 64 bit id consists of: |
| // array utils | |
| // ================================================================================================= | |
| const combine = (...arrays) => [].concat(...arrays); | |
| const compact = arr => arr.filter(Boolean); | |
| const contains = (() => Array.prototype.includes | |
| ? (arr, value) => arr.includes(value) | |
| : (arr, value) => arr.some(el => el === value) |
| /* | |
| * The reason for this is just a thought exercise | |
| * often people(myself super included) are so confused | |
| * when trying something new, but breaking it down | |
| * to it's simplest existence can be the best way to understand | |
| */ | |
| function createStore(reducer, initState) { | |
| let state = initState; | |
| let subscribers = []; |
Picking the right architecture = Picking the right battles + Managing trade-offs