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 child_process = require('child_process'); | |
exports.handler = function(event, context) { | |
var proc = spawn('./test', [ JSON.stringify(event) ], { stdio: 'inherit' }); | |
proc.on('close', function(code){ | |
if(code !== 0) { | |
return context.done(new Error("Process exited with non-zero status code")); | |
} |
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 exec = require('child_process').exec; | |
console.log('Loading event'); | |
exports.handler = function(event, context) { | |
eventJSON = JSON.stringify(event); | |
exec('./test ' + eventJSON, function callback(error, stdout, stderr) { | |
console.log('stdout: ' + stdout); | |
console.log('stderr: ' + stderr); |
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
# | |
# CodeSkuptor URL: | |
# http://www.codeskulptor.org/#user40_werrOBjB7u_0.py | |
# | |
# spaceship.py | |
# github.com/gnagel | |
# 2015/08/01 | |
# | |
# | |
# |
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
# | |
# CodeSkuptor URL: | |
# http://www.codeskulptor.org/#user40_qps4KtZAHn_0.py | |
# | |
# guess_the_number.py | |
# github.com/gnagel | |
# 2015/08/01 | |
# | |
# | |
# We have provided a basic template for this mini-project here. |
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
# | |
# CodeSkulptor URL: | |
# http://www.codeskulptor.org/#user40_cA4au5WIDr_0.py | |
# | |
# | |
# blackjack.py | |
# 2015-07-25 | |
# github.com/gnagel | |
# | |
# |
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
# | |
# CodeSkuptor URL: | |
# http://www.codeskulptor.org/#user40_0zoDGCu9x5_0.py | |
# | |
# memory.py | |
# 2015-07-25 | |
# github.com/gnagel | |
# | |
# | |
# Mini-project description - Memory (late version - half credit) |
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
# | |
# CodeSkulptor URL: | |
# http://www.codeskulptor.org/#user40_H6qP6dj1LU_0.py | |
# | |
# rock_spock_paper_lizard_scissors.py | |
# 2015-07-25 | |
# github.com/gnagel | |
# | |
# | |
# Rock-paper-scissors is a hand game that is played by two people. |
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
/** | |
* Parse query string. | |
* ?a=b&c=d to {a: b, c: d} | |
* @param {String} (option) queryString | |
* @return {Object} query params | |
*/ | |
getQueryParams: function(queryString) { | |
var query = (queryString || window.location.search).substring(1); // delete ? | |
if (!query) { | |
return false; |
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
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
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
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |