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
<div class="container flipped"> | |
<p>Container View</p> | |
<p><button class="btn-open" type="submit">Reopen modal</button></p> | |
</div> | |
<div class="modal"> | |
<div class="modal-popup"> | |
<h1>Welcome.</h1> | |
<div class="modal-popup__field"> | |
<p> |
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 net = require('net'); | |
var sockets = []; | |
var port = 8000; | |
var guestId = 0; | |
var server = net.createServer(function(socket) { | |
// Increment | |
guestId++; | |
socket.nickname = "Guest" + guestId; |
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
"" General | |
set number "" Show line numbers | |
set linebreak "" Break lines at word (requires Wrap lines) | |
set showbreak=+++ "" Wrap-broken line prefix | |
set textwidth=100 "" Line wrap (number of cols) | |
set showmatch "" Highlight matching brace | |
set visualbell "" Use visual bell (no beeping) | |
set smartcase "" Enable smart-case search | |
set ignorecase "" Always case-insensitive |
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
const http = require('http'); | |
const { parse } = require('querystring'); | |
const server = http.createServer((req, res) => { | |
if (req.method === 'POST') { | |
collectRequestData(req, result => { | |
console.log(result); | |
res.end(`Parsed data belonging to ${result.fname}`); | |
}); | |
} |
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
const express = require('express'); | |
const request = require('request'); | |
const app = express(); | |
const oauthDetails = { | |
client_id: '[your client id]', | |
client_secret: '[your client secret]', | |
redirect_uri: 'http://localhost:3000/oauth/callback' | |
}; |
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
app.get('/oauth/callback', (req, res) => { | |
const { client_id, client_secret, redirect_uri } = oauthDetails; | |
const { code } = req.query; | |
const monzoAuthUrl = `https://api.monzo.com/oauth2/token`; | |
// Initiate request to retrieve access token | |
request.post({ | |
url: monzoAuthUrl, | |
form: { | |
grant_type: 'authorization_code', |
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
app.get('/accounts', (req, res) => { | |
const { token_type, access_token } = accessToken; | |
const accountsUrl = 'https://api.monzo.com/accounts'; | |
request.get(accountsUrl, { | |
headers: { | |
Authorization: `${token_type} ${access_token}` | |
} | |
}, (req, response, body) => { | |
const { accounts } = JSON.parse(body); |
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
app.get('/transactions/:acc_id', (req, res) => { | |
const { acc_id } = req.params; | |
const { token_type, access_token } = accessToken; | |
const transactionsUrl = `https://api.monzo.com/transactions?expand[]=merchant&account_id=${acc_id}&limit=30`; | |
request.get(transactionsUrl, { | |
headers: { | |
Authorization: `${token_type} ${access_token}` | |
} | |
}, (req, response, body) => { |
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
const express = require('express'); | |
const request = require('request'); | |
const app = express(); | |
const oauthDetails = { | |
client_id: '[your client id]', | |
client_secret: '[your client secret]', | |
redirect_uri: 'http://localhost:3000/oauth/callback' | |
}; |
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
class Person { | |
String _name; | |
int _age; | |
String occupation; | |
List<String> hobbies; | |
Person(this._name, this._age, [ this.occupation, this.hobbies ]); | |
String getIntro() => 'Name: $_name. Age: $_age. Occupation: $occupation'; | |
OlderNewer