Skip to content

Instantly share code, notes, and snippets.

View graphicbeacon's full-sized avatar
🏠
Working from home

Jermaine Oppong graphicbeacon

🏠
Working from home
View GitHub Profile
@graphicbeacon
graphicbeacon / SassMeister-input-HTML.html
Created March 18, 2014 20:58
A simple modal popup experiment using CSS transitions and transforms. Created at http://sassmeister.com
<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>
@graphicbeacon
graphicbeacon / .vimrc
Last active August 29, 2015 14:12
Configurations for VIM Editor. This relies on the use of some plugins, namely NERDTree, Easymotion, NeoBundle, Pathogen
"" 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
@graphicbeacon
graphicbeacon / index-snippet4.js
Created March 11, 2018 16:17
How to create an application using the Monzo Bank API
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) => {
@graphicbeacon
graphicbeacon / index-snippet3.js
Last active March 11, 2018 17:00
How to create an application using the Monzo Bank API
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);
@graphicbeacon
graphicbeacon / index-snippet1.js
Last active March 11, 2018 17:20
How to create an application using the Monzo Bank API
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'
};
@graphicbeacon
graphicbeacon / index-snippet2.js
Last active March 11, 2018 17:28
How to create an application using the Monzo Bank API
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',
@graphicbeacon
graphicbeacon / main.dart
Last active April 15, 2018 00:28
A basic program written in the Dart programming language
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';
@graphicbeacon
graphicbeacon / main_order1.dart
Last active April 21, 2018 18:40
Sample code for 'Learn Dart Before You Flutter' blog post on Medium (1)
class Order {
var _id;
var _reference;
var _date;
Order(id, reference, date) {
this._id = id;
this._reference = reference;
this._date = date;
}
@graphicbeacon
graphicbeacon / main.dart
Created April 21, 2018 18:41
Sample code for 'Learn Dart Before You Flutter' blog post on Medium (2)
class Order {
var _id;
var _reference;
var _date;
Order(this._id, this._reference, this._date);
getInfo() {
return 'Your order information:'
'\n-------------------------------'
@graphicbeacon
graphicbeacon / main.dart
Last active April 21, 2018 20:01
Sample code for 'Learn Dart Before You Flutter' blog post on Medium (3)
class Order {
int _id;
String _reference;
DateTime _date;
String code; // public property
Order(this._id, this._reference, this._date);
Order.withDiscount(this._id, this._reference, {this.code}) {
_date = new DateTime.now();
}