Use these rapid keyboard shortcuts to control the GitHub Atom text editor on macOS.
- ⌘ : Command key
- ⌃ : Control key
- ⌫ : Delete key
- ← : Left arrow key
- → : Right arrow key
- ↑ : Up arrow key
function loadDev(){ | |
var jq = document.createElement("script"); | |
jq.setAttribute("src","http://code.jquery.com/jquery-2.1.0.js") | |
document.head.appendChild(jq); | |
var us = document.createElement("script"); | |
us.setAttribute("src","http://underscorejs.org/underscore.js") | |
document.head.appendChild(us); | |
console.log("Loaded Jquery and Underscore") | |
} | |
loadDev() |
## IMPORTANT -> The expectation must come before the invocation, so that it can catch the invocation when it happens | |
# Able to stub an instance's method. Will return whatever is in the block. The instance's method would have to be invoked in the RSpec. | |
@person.stub(:get_relevant_experts) { @collection_of_possibilities } | |
# Expectation of an instance that is available in the testing context to receive a particular method, choose return value | |
expect(@person).to receive(:get_relevant_experts).with("Medical").and_return(@collection_of_possibilities) | |
# Expectation of an instance to receive a method and return a result | |
expect_any_instance_of(Classification).to receive(:valid_matches).and_return(@collection_of_possibilities) |
# echo is like puts for bash (bash is the program running in your terminal) | |
echo "Loading ~/.bash_profile a shell script that runs in every new terminal you open" | |
# $VARIABLE will render before the rest of the command is executed | |
echo "Logged in as $USER at $(hostname)" | |
# Rbenv autocomplete and shims | |
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi | |
# Path for RBENV | |
test -d $HOME/.rbenv/ && PATH="$HOME/.rbenv/bin:$PATH" |
var fs = require('fs'); | |
var csv = require('fast-csv'); | |
var stream = fs.createReadStream('/home/jaywon/Downloads/modified-salary-per-state-per-jobtitle.csv'); | |
var mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
var masterList = []; | |
var mongoose = require('mongoose'); | |
mongoose.connect('mongodb://localhost:27017/job-imports'); | |
//define schema for import data |
// use this format since .eslintrc is deprecated. | |
// You can logically derive this format. | |
module.exports = { | |
parser: 'babel-eslint', | |
extends: [ | |
'plugin:flowtype/recommended', | |
'plugin:jest/recommended', | |
'plugin:react/recommended', | |
'eslint-config-airbnb', |
Use these rapid keyboard shortcuts to control the GitHub Atom text editor on macOS.
ActiveRecord cheat sheet / EXAMPLES | |
INSTALL | |
======= | |
$ gem install activerecord | |
in GEMFILE: gem ‘activerecord’ | |
REQUIRE | |
======= | |
require ‘active_record’ |
# Sample implementation of quicksort and mergesort in ruby | |
# Both algorithm sort in O(n * lg(n)) time | |
# Quicksort works inplace, where mergesort works in a new array | |
def quicksort(array, from=0, to=nil) | |
if to == nil | |
# Sort the whole array, by default | |
to = array.count - 1 | |
end |
/* 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'); |