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
mysql> use wild_db_quest_2 | |
Database changed | |
mysql> SELECT lastname, firstname, role, name AS teamname | |
-> FROM wizard | |
-> JOIN player ON player.wizard_id = wizard.id | |
-> JOIN team ON player.team_id = team.id | |
-> ORDER BY teamname, role, lastname, firstname; | |
+-----------------+-------------+--------+------------+ | |
| lastname | firstname | role | teamname | | |
+-----------------+-------------+--------+------------+ |
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
const connection = require('./db-config'); | |
connection.connect(function (err) { | |
if (err) { | |
console.error('error connecting: ' + err.stack); | |
return; | |
} | |
console.log('connected as id ' + connection.threadId); | |
}); |
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
const connection = require('./db-config'); | |
connection.connect(function (err) { | |
if (err) { | |
console.error('error connecting: ' + err.stack); | |
return; | |
} | |
console.log('connected as id ' + connection.threadId); | |
}); |
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
const connection = require('./db-config'); | |
connection.connect(function (err) { | |
if (err) { | |
console.error('error connecting: ' + err.stack); | |
return; | |
} | |
console.log('connected as id ' + connection.threadId); | |
}); |
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
// https://imgur.com/a/hXtrYLB | |
const connection = require('./db-config'); | |
connection.connect(function (err) { | |
if (err) { | |
console.error('error connecting: ' + err.stack); | |
return; | |
} | |
console.log('connected as id ' + connection.threadId); |
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
### GET status of custom API for this quest | |
GET https://http-practice.herokuapp.com/status | |
### GET application status is JSON format | |
GET https://http-practice.herokuapp.com/status | |
Accept: application/json | |
### GET Wilders API | |
GET https://http-practice.herokuapp.com/wilders | |
Accept: application/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
function encodeRailFenceCipher(string, numberRails) { | |
// initialise empty rails arrays | |
const rails = []; | |
while (rails.length < numberRails) {rails.push([])}; | |
// loop over rails subarrays, "bouncing" to add string chars in the fence pattern | |
let counter = 0; | |
let increment = 1; | |
for (let i = 0; i < string.length; i++) { | |
counter += increment; |
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
const quaiFM = [47.2076056402, -1.55753246791]; | |
const testMarker = [47.21, -1.552]; | |
const rdgReze = [47.19316, -1.549212]; | |
const plWalRou = [47.2277747611, -1.55214798607]; | |
// function to calculate distance - expects array of lat / long for each param | |
// this is no good due to the difference in conversion offset degrees / metres between lat and long! | |
calcDistance = function (origin, dest) { | |
const xOffset = origin[1] - dest[1]; | |
const yOffset = origin[0] - dest[0]; |
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
const http = require('http'); | |
const url = require('url'); | |
const port = 8000; | |
const requestHandler = (request, response) => { | |
const parsedUrl = url.parse(request.url, true); | |
if (parsedUrl.query.name && parsedUrl.query.city) { | |
response.end(`Hello, ${parsedUrl.query.name} from ${parsedUrl.query.city}!`); | |
} else { | |
response.end('Please provide name AND city parameters'); |
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
tom@LAPTOP-BGP53NKI:~/quests/shell$ curl -L -o planets.zip https://github.com/WildCodeSchool/quests-resources/blob/master/terminal/planets.zip?raw=true | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 148 100 148 0 0 393 0 --:--:-- --:--:-- --:--:-- 393 | |
100 159 100 159 0 0 358 0 --:--:-- --:--:-- --:--:-- 358 | |
100 293k 100 293k 0 0 302k 0 --:--:-- --:--:-- --:--:-- 302k | |
tom@LAPTOP-BGP53NKI:~/quests/shell$ ls | |
fruits planets.zip vegetables | |
tom@LAPTOP-BGP53NKI:~/quests/shell$ unzip planets.zip | |
Archive: planets.zip |