Skip to content

Instantly share code, notes, and snippets.

View notrab's full-sized avatar

Jamie Barton notrab

View GitHub Profile
const { send } = require('micro')
const { get, router } = require('microrouter')
const cors = require('micro-cors')()
const moltinGateway = require('@moltin/sdk').gateway
const moltin = moltinGateway({
client_id: process.env.MOLTIN_CLIENT_ID,
client_secret: process.env.MOLTIN_CLIENT_SECRET
})
@notrab
notrab / README.md
Created March 7, 2018 10:07
Custom moltin storage engines

Moltin JavaScript SDK

npm version

A simple to use API interface to help get you off the ground quickly and efficiently with your Moltin JavaScript apps.

📚 API reference — 📚 moltin.com

Installation

module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 16,
// font family with optional fallbacks
fontFamily:
'Operator Mono, Menlo, "DejaVu Sans Mono", "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
const initialState = {
minDb: 29,
maxDb: 35,
glazedOnly: false,
unglazedOnly: false,
doorTypes: [],
doorWidths: [],
manufacturer: [],
dirty: false,
isFiltering: false,
@notrab
notrab / embed.js
Created March 8, 2017 09:45
Partial refactor
const EMBED_ID = '<%= embedId %>'
const APP_URL = '<%= appUrl %>'
const RGB = '<%= rgb %>'
const TEXT_COLOR = '<%= textColor %>'
const RED = '<%= red %>'
const GREEN = '<%= green %>'
const BLUE = '<%= blue %>'
const _getElement = selector => {
return document.querySelector(selector)
const express = require('express')
const path = require('path')
const app = express()
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs')
app.get('/test', (req, res) => {
res.render('home')
})
@notrab
notrab / app.js
Last active March 19, 2018 11:28
<Dropdown>
<DropdownItem to="/projects">My Projects</DropdownItem>
<DropdownItem to="/projects">Edit Profile</DropdownItem>
<DropdownItem to="/projects">Logout</DropdownItem>
</Dropdown>
#!/bin/sh
brew install Caskroom/cask/java
brew cask install google-chrome
brew cask install mongodb
brew cask install vlc
brew cask install atom
brew cask install sequel-pro
brew cask install spotify
brew cask install elasticsearch17
@notrab
notrab / bug1.md
Last active June 3, 2016 11:33
Twocards.co Payment Validation Error
  1. View an invoice as a guest

  2. Click 'Pay Using Card'

Uncaught TypeError: Cannot read property 'number' of undefined

if (vm.card.number == '') {
$(document).on('ready', function() {
return this.on('#enquiry-modal submit', 'form[data-analytics-submit]', function(e) {
if (window.ga) {
return window.ga('send', 'Send Message', $(this).attr('data-analytics-submit'), 'submit');
}
});
});