Skip to content

Instantly share code, notes, and snippets.

View bookercodes's full-sized avatar

Alex Booker bookercodes

View GitHub Profile
"*":
"advanced-open-file":
createDirectories: true
core:
audioBeep: false
autoHideMenuBar: true
disabledPackages: [
"hard-wrap"
"emoji-syntax"
"linter-flow"
const getRandomInt = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min
const getRandomPastelColor = () => {
const redHex = (getRandomInt(0, 128) + 127).toString(16)
const greenHex = (getRandomInt(0, 128) + 127).toString(16)
const blueHex = (getRandomInt(0, 128) + 127).toString(16)
return `#${redHex}${greenHex}${blueHex}`
}
import React from 'react'
import { StyleSheet, css } from 'aphrodite'
import Icon from './Icon'
import {accentColor, white} from '../styles/variables'
const atLeastMedium = '@media only screen and (min-width : 350px)'
const atLeastLarge = '@media only screen and (min-width : 1050px)'
function FooterNav () {
// In an attempt to reproduce http://stackoverflow.com/questions/37432676/node-js-sequelize-orm-date-issue...
const Sequelize = require('sequelize')
const connection = new Sequelize('so_schema', 'root', '')
const customer = connection.define('customer', {
dob: Sequelize.DATE
})
connection.sync({
// @flow
import db from 'sequelize-connect'
/**
* Creates and returns a Sequelize screencast model. (This function is to be
* called internally by the sequelize-connect module.)
*
* @param sequelize - A Sequelize connection
* @param DataTypes - A quasi enumeration of SQL data types
*/

Firefox vs. Chromium (on Linux)

Every few months I impulsively switch between Firefox and Chromium on (Arch) Linux. Whilst both browsers have their limitations, at this moment in time, I ultimately prefer Chromium.

I think I'm prone to forget what I like and dislike about each browser so I'm writing this little list for my future reference. Maybe you'll find it useful, too.

Firefox

✅ Advantages

Micro Post: Sneaky Arrow Functions

I was just hacking away on a side project when I wrote this code:

const screencastMock = {
  findOne: () => { }
};
NeoBundleLazy 'mxw/vim-jsx', {'on_ft': 'javascript'}
NeoBundleLazy 'othree/yajs.vim', {'on_ft': 'javascript'}
NeoBundleLazy 'othree/es.next.syntax.vim', {'on_ft': 'javascript'}
NeoBundleLazy 'gavocanov/vim-js-indent', {'on_ft': 'javascript'}
// npm i moment youtube-api youtube-url
import {extractId} from 'youtube-url'
import youtubeApiClient from 'youtube-api'
import moment from 'moment'
export default class YouTube {
constructor(youtubeApiKey: string) {
youtubeApiClient.authenticate({
type: 'key',