Skip to content

Instantly share code, notes, and snippets.

@matthewmueller
matthewmueller / mail.php
Created Sep 21, 2020
Laravel mailer configuration
View mail.php
/*
|--------------------------------------------------------------------------
| Mailer Configurations
|--------------------------------------------------------------------------
|
| Here you may configure all of the mailers used by your application plus
| their respective settings. Several examples have been configured for
| you and you are free to add your own as your application requires.
|
@matthewmueller
matthewmueller / database.yml
Created Sep 21, 2020
Rails Configuration with Environment
View database.yml
# SQLite. Versions 3.8.0 and up are supported.
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
adapter: sqlite3
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000
@matthewmueller
matthewmueller / responsewriter.go
Created Aug 31, 2020
ResponseWriter wrapper to allows middleware to set headers without worrying about the response header being written already.
View responsewriter.go
package responsewriter
import (
"bytes"
"net/http"
"github.com/felixge/httpsnoop"
)
// Wrap the response writer
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
}
You can’t perform that action at this time.