This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
########## | |
# PROMPT # | |
########## | |
- This vending machine must take user inputs (i.e. A1, A2, B1..etc) and dispenses an item after users input money. | |
- There are only 9 inputs. | |
- Assume that there are different kinds of items in the vending machine (Sprite, cheetos, etc). | |
- The vending machine must store instances of items to be dispensed, the item can't be created at the moment someone requests it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function evaluate(string){ | |
// reverse string & evaluate backwards to keep indexes relevant | |
console.log('original string: ', string); | |
string = reverseString(string); | |
var opArr = []; | |
var singleExp; | |
var firstPart; | |
var secondPart; | |
var evalString; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gyp ERR! node-gyp -v v1.0.1 | |
gyp ERR! not ok | |
node-pre-gyp ERR! build error | |
node-pre-gyp ERR! stack Error: Failed to execute '/home/james/.nvm/versions/node/v5.4.1/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/james/js_lab/makerSquare/4week/MKS-SF-shortly-express/node_modules/sqlite3/lib/binding/node-v47-linux-ia32/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/james/js_lab/makerSquare/4week/MKS-SF-shortly-express/node_modules/sqlite3/lib/binding/node-v47-linux-ia32 --python=/usr/bin/python2.6' (1) | |
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/james/js_lab/makerSquare/4week/MKS-SF-shortly-express/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:83:29) | |
node-pre-gyp ERR! stack at emitTwo (events.js:87:13) | |
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:172:7) | |
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:821:16) | |
node-pre-gyp ERR! stack at Process |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
co = checkout | |
ci = commit | |
st = status | |
br = branch | |
lg = log --graph --full-history --all --color --pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s[%an]" | |
type = cat-file -t | |
dump = cat-file -p | |
[user] | |
name = James Youn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "keys": ["ctrl+super+l"], "command": "angularjs_find" }, | |
{ "keys": ["alt+up"], "command": "move_text_up" }, | |
{ "keys": ["alt+down"], "command": "move_text_down" }, | |
{ "keys": ["ctrl+q"], "command": "noop" }, | |
{ "keys": ["j", "k"], "command": "chain", | |
"args": { | |
"commands": [ | |
["exit_insert_mode"], | |
["save"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"color_scheme": "Packages/User/SublimeLinter/All Hallow's Eve (SL).tmTheme", | |
"font_size": 9, | |
"ignored_packages": | |
[ | |
"" | |
], | |
"tab_size": 2, | |
"translate_tabs_to_spaces": true, | |
"vintage_start_in_command_mode": true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getElementsByClassName = function(className){ | |
// Array of document element | |
var elementList = Array.prototype.slice.call( | |
document.body.querySelectorAll('*') | |
); | |
var results = []; | |
var count = elementList.length; | |
// check body independently since the above array doesn't contain 'body' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.memoize = function(func) { | |
var history = {}; | |
var result; | |
return function() { | |
var args = Array.prototype.slice.call(arguments); // to set as object keys | |
var setResult = function(func){ | |
result = func.apply(this, args); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.memoize = function(func) { | |
var history = {}; | |
/* PSEUDO CODE | |
check if func & arguments in history | |
if they are: look up the stored return value | |
if not: run it with 'once' and store it in 'history' as an object with 3 properties: | |
history = { | |
{ | |
function: ____, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sort = function(arr){ | |
var newArray = []; | |
var copyOfArr = arr; | |
var count = arr.length; | |
while(copyOfArr.length > 0){ | |
var minIndex = copyOfArr.indexOf(Math.min.apply(null, arr)); | |
newArray.push(Number(copyOfArr.splice(minIndex, 1))); | |
} | |
return newArray; |