Skip to content

Instantly share code, notes, and snippets.

@QuotableWater7
QuotableWater7 / vscode-settings-quotablewater7
Created August 5, 2020 16:46
vscode-settings-quotablewater7
{
"workbench.editor.enablePreviewFromQuickOpen": false,
"workbench.editor.enablePreview": false,
"editor.minimap.enabled": false,
"sync.removeExtensions": true,
"sync.gist": "vscode-settings-quotablewater7"
}
#!/bin/bash
BIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# add a newline before printing text
fancy_echo() {
local fmt="$1"; shift
printf '\n%s\n' "$fmt" "$@"
}
@QuotableWater7
QuotableWater7 / type-errors.js
Last active November 12, 2019 16:58
Examples of express behavior for TypeErrors
'use strict'
const express = require('express')
const request = require('request')
const configureRoute = handler => async (req, res, next) => {
try {
handler(req, res, next)
} catch (error) {
// we successfully caught an error
@QuotableWater7
QuotableWater7 / useful-unix-commands.md
Last active November 8, 2016 19:39
Commands that reduce manual boilerplate

Create index file in matching directories:

find ./server/app/pq/**/mason -type d -exec touch {}/index.js \;
@QuotableWater7
QuotableWater7 / websafe_color_converter.rb
Created July 26, 2016 15:11
Websafe Color Converter
class WebsafeColorConverter
class InvalidHexError < StandardError; end;
def call(hex_color)
raise InvalidHexError unless valid_hex?(hex_color)
return hex_color if valid_3_char_hex?(hex_color)
return websafe_hex_color(hex_color) if valid_6_char_hex?(hex_color)