Skip to content

Instantly share code, notes, and snippets.

View grammar.go
package route
//go:generate peg -switch -inline grammar.peg
import (
"regexp"
"github.com/kr/pretty"
)
View plugin.go
package plugin
import (
"fmt"
"io"
"os"
"os/exec"
"strconv"
)
View index.js
// Usage:
// $ node index.js
//
// Code to generate this. Should be modified to auto-generate tables, columns, etc.
const types = [
'bigint',
'int8',
'bigserial',
@matthewmueller
matthewmueller / custom-capslock.json
Last active Oct 23, 2019
Change caps_lock to command+control+option+shift or F19 if tapped.
View custom-capslock.json
{
"title": "Change caps_lock to command+control+option+shift or F19 if tapped",
"rules": [
{
"description": "Change caps_lock to command+control+option+shift or F19 if tapped",
"manipulators": [
{
"from": {
"key_code": "caps_lock",
"modifiers": {
@matthewmueller
matthewmueller / custom-capslock.json
Created Oct 23, 2019
Change caps_lock to command+control+option+shift or F19 if tapped
View custom-capslock.json
{
"title": "Change caps_lock to Esc and Control",
"rules": [
{
"description": "Change caps_lock to command+control+option+shift or F19 if tapped",
"manipulators": [
{
"from": {
"key_code": "caps_lock",
"modifiers": {
@matthewmueller
matthewmueller / Readme.md
Last active Sep 18, 2019
Inlets Unit file for Amazon Linux 2
View Readme.md
@matthewmueller
matthewmueller / index.js
Created Mar 12, 2019
async constructors
View index.js
class Car {
constructor() {
return Promise.resolve(this.new())
}
async new() {
await this.sleep(1000)
this._wheels = 4
return this
}
View Readme.md

Installation

yarn add express
node index.js

How to Test

I ran this test on Chrome. To see it getting the flash of unstyled content, you'll need to set the 3G setting in Chrome Dev Tools:

@matthewmueller
matthewmueller / split-by-slash.go
Created Feb 16, 2018
Nice little function to split by slashes while ignoring slashes inside quotes (e.g. /Invoices/"Invoice (9/1)"/invoice.txt)
View split-by-slash.go
func splitBySlash(s string) []string {
lastQuote := rune(0)
slash := rune(filepath.Separator)
f := func(c rune) bool {
switch {
case c == lastQuote:
lastQuote = rune(0)
return false
case lastQuote != rune(0):
View layout.css
/*******************************
Flex Layout
*******************************/
.layout.horizontal,
.layout.horizontal-reverse,
.layout.vertical,
.layout.vertical-reverse {
display: -ms-flexbox;
display: -webkit-flex;
You can’t perform that action at this time.