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
<!DOCTYPE html> | |
<head> | |
</head> | |
<body> | |
<div id="song1"> | |
<button onclick="playSong1()">play</button> | |
<button onclick="mySource.setPosition(-0.9, 8.9, 0)">right 1</button> | |
<button onclick="mySource.setPosition(-2, 8.9, -1)">right 2</button> | |
<button onclick="mySource.setPosition(-1, 8.9, -2)">right 3</button> |
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
from flask import Flask | |
from pymongo import MongoClient | |
from bson.json_util import dumps | |
app = Flask(__name__) | |
db = MongoClient('mongodb://<dbuser>:<dbpass>@localhost:27017/mydb')['mydb'] | |
@app.route('/') | |
def index(): | |
return 'Hello, World!' |
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
mongoimport -h localhost -d dbname -c collectionname --jsonArray --file petflix.json |
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
:Class Bitmap | |
:Field Public FileTie | |
:Field Public BMPHeader | |
:Field Public DIPHeader | |
:Field Public ImageTable | |
:Field Public ImageWidth | |
:Field Public ImageHeight | |
:Field Public ImageDataOffset | |
:Field Public Bytes |
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
console.log('US numbers:'); | |
getPrimePhoneNumbers('US', 650).then(data => console.log(data)); | |
// Search by area code only works for US and Canada. Twilio just ignores it for other countries | |
console.log('UK numbers:'); | |
getPrimePhoneNumbers('GB').then(data => console.log(data)); |
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 twilio = require('twilio'); | |
var primality = require('primality'); | |
var countries = require('./countries'); | |
const accountSid = process.env.TWILIO_AC_SID; | |
const authToken = process.env.TWILIO_AUTH_TOKEN; | |
var client = require('twilio')(accountSid, authToken); | |
function getRandomInt(min, max) { | |
// max and min numst be integers |
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 getPrimePhoneNumbers(isoCountry, areaCode) { | |
// ... | |
// Get the length of the country code so we know what to cut off from the number | |
let countryCodeLen = countries[isoCountry].code.length; | |
// assign the resolution of phonePromise to a variable | |
let primeNumberPromise = phonePromise.then(data => { | |
var verifiedPrimes = []; |
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
let twilioPromise = client.availablePhoneNumbers(isoCountry).local.list({ | |
Contains: getRandomInt(10,99), | |
areaCode: areaCode | |
}); |
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 getPrimePhoneNumbers(isoCountry, areaCode) { | |
// ... | |
} |
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
module.exports = { | |
US: { | |
name: "United States", | |
code: "+1", | |
}, | |
AU: { | |
name: "Australia", | |
code: "+61", | |
}, | |
AT: { |