Skip to content

Instantly share code, notes, and snippets.

View jfstgermain's full-sized avatar

Jean-François St-Germain jfstgermain

View GitHub Profile
logger = {
log: sinon.spy()
};
const greetings = moduleA.greet('Joe Trudeau', logger);
expect(logger.log).to.have.been.calledOnce;
expect(logger.log).to.have.been.calledWith('Greeting: Joe Trudeau');
autoload -U add-zsh-hook
load-nvmrc() {
local node_version="$(nvm version)"
local nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "$nvmrc_node_version" != "N/A" ] && [ "$nvmrc_node_version" != "$node_version" ]; then
nvm install
@jfstgermain
jfstgermain / System Design.md
Created April 18, 2016 20:36 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@jfstgermain
jfstgermain / hypem.php
Created October 2, 2015 15:53 — forked from tcz/hypem.php
Copy Hypem favorites to Spotify
<?php
if ($argc !== 2)
{
die("Usage: php {$argv[0]} hypem_user_name\n\n");
}
$user = $argv[1];
$page = 1;
$all_songs = array();

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
info: Creating snapshot 0.0.0-71
info Uploading: [============================ ] 96%
info: Updating app meatme
info: Activating snapshot 0.0.0-71 for meatme
info: Starting app meatme
info: Creating snapshot 0.0.0-54
info: Creating snapshot 0.0.0-54
info: Updating app meatme
info: Activating snapshot 0.0.0-54 for meatme
info: Starting app meatme
error: Error running command deploy
error: Error running command deploy
error: socket hang up
help: For help with this error contact Nodejitsu Support:
help: webchat: <http://webchat.nodejitsu.com/>
[jfstgermain@cloud9]:/workspace$ jitsu deploy
info: Welcome to Nodejitsu creatix
info: jitsu v0.10.3-1, node v0.6.21
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in app-compiled/server.js
Completed executing coffee
Completed executing coffee
info: Creating snapshot 0.0.0-50
readline.js:58
jfstgermain@meatme:~/276715 (master) $ du -skh * | sort -n
0 README
1.3M build
4.0K Cakefile
4.0K database.json
[jfstgermain@cloud9]:/workspace$ jitsu deploy
info: Welcome to Nodejitsu creatix
info: jitsu v0.9.8
info: jitsu v0.9.8
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in app-compiled/server.js
Completed executing coffee
warn: Local package version appears to be old
warn: The package.json version will be incremented automatically