This file contains 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
{ | |
"swagger": "2.0", | |
"info": { | |
"title": "Flashcards API", | |
"description": "Learn with flashcards API", | |
"version": "1.0.0" | |
}, | |
"host": "api.flashcards.com", | |
"schemes": [ | |
"http" |
This file contains 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 test = new Promise( function(resolve, reject){ | |
setTimeout( function(){ | |
resolve('hello world') | |
}, 3000) | |
}) | |
function anotherAsync(){ | |
return new Promise( function(resolve){ | |
throw new Error('testing') | |
setTimeout( resolve, 1000 ) |
This file contains 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 getSomething(){ | |
return new Promise( (resolve, reject) => { | |
request | |
.post('/api/pet') | |
.send({ name: 'Manny', species: 'cat' }) | |
.set('X-API-Key', 'foobar') | |
.set('Accept', 'application/json') | |
.end(function(err, res){ | |
if(err) return reject(err); |
This file contains 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 copy(string){ | |
var dummy = document.createElement("input"); | |
// Add it to the document | |
document.body.appendChild(dummy); | |
// Set its ID | |
dummy.setAttribute("id", "dummy_id"); | |
// Output the array into it | |
document.getElementById("dummy_id").value = string; | |
// Select it |
This file has been truncated, but you can view the full file.
This file contains 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
[{"id":35866694,"name":"Rocket.Chat","full_name":"RocketChat/Rocket.Chat","owner":{"login":"RocketChat","id":12508788,"avatar_url":"https://avatars.githubusercontent.com/u/12508788?v=3","gravatar_id":"","url":"https://api.github.com/users/RocketChat","html_url":"https://github.com/RocketChat","followers_url":"https://api.github.com/users/RocketChat/followers","following_url":"https://api.github.com/users/RocketChat/following{/other_user}","gists_url":"https://api.github.com/users/RocketChat/gists{/gist_id}","starred_url":"https://api.github.com/users/RocketChat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RocketChat/subscriptions","organizations_url":"https://api.github.com/users/RocketChat/orgs","repos_url":"https://api.github.com/users/RocketChat/repos","events_url":"https://api.github.com/users/RocketChat/events{/privacy}","received_events_url":"https://api.github.com/users/RocketChat/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https:/ |
This file contains 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 teamSchema = new Schema({ | |
name: {type: String}, | |
king: {type: Schema.Types.ObjectId, ref: 'User'}, | |
players: [{type: Schema.Types.ObjectId, ref: 'User'}], | |
subs: [{type: Schema.Types.ObjectId, ref: 'User'}] | |
}) | |
var gameSchema = new Schema({ | |
name: {type: String, default: ''}, | |
status: { |
This file contains 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 convert(num) { | |
console.log('number', num); | |
var romans = [ | |
{ val: 1000, symbol: 'M' }, | |
{ val: 500, symbol: 'D', odd: true }, | |
{ val: 100, symbol: 'C' }, | |
{ val: 50, symbol: 'L', odd: true }, | |
{ val: 10, symbol: 'X' }, | |
{ val: 5, symbol: 'V', odd: true }, | |
{ val: 1, symbol: 'I' } |
This file contains 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
//how would you go from [1,2,3,4,5,6] to [ [1,2,3], [4,5,6] ] |
This file contains 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
Sequel.migration do | |
up do | |
create_table :locations do | |
primary_key :id | |
String :address | |
String :lat | |
String :long | |
DateTime :created_at | |
DateTime :updated_at | |
end |
This file contains 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
$json = "{ | |
rule_type: 'standard', | |
aggregate: { | |
action: 'sum', | |
column: 'amount' | |
}, | |
trans_type: ['a','o','r'], | |
interval: 'monthly', | |
value: { | |
gt: 1000000 |