updated list moved to https://grin.io/coding-maxims
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[color] | |
diff = auto | |
status = auto | |
branch = auto | |
ui = auto | |
[core] | |
autocrlf = input | |
safecrlf = true | |
pager = cat | |
[alias] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Files</title> | |
</head> | |
<body> | |
<div id="navigation"></div> | |
<div id="listing"></div> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:!function(){var a=document.createElement("style");a.type="text/css";a.innerHTML="p:hover, li:hover, dt:hover, dd:hover, h1:hover, h2:hover, h3:hover, h4:hover, h5:hover, h6:hover { outline: 2px solid red; }";document.body.appendChild(a);var d=function(c){var b=c.target.innerText;c.target.innerHTML=b.substring(0,45)+"<span style='color: red;'>"+b.substring(45,75)+"</span>"+b.substring(75);document.removeEventListener("click",d);a.parentNode.removeChild(a)};document.addEventListener("click",d)}(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DANGER: this will delete all search engines that don't have a `.` in their keyword | |
// Go to chrome://settings/searchEngines and put this in the console | |
settings.SearchEnginesBrowserProxyImpl.prototype.getSearchEnginesList() | |
.then(function(val) { | |
val.others.sort(function(a, b) { return b.modelIndex - a.modelIndex; }); | |
val.others.forEach(function(engine) { | |
if (engine.keyword.includes(".")) { | |
settings.SearchEnginesBrowserProxyImpl.prototype.removeSearchEngine(engine.modelIndex); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html><head> | |
<meta charset="utf-8" /> | |
<title>Site Maintenance</title> | |
<style type="text/css"> | |
body { padding: 50px 30px 30px; font: 20px Helvetica, sans-serif; color: #222; line-height: 1.4 } | |
h1 { font-size: 40px; } | |
article { text-align: left; max-width: 650px; margin: 0 auto; } | |
a { color: #dc8100; padding: 3px } | |
a:hover { color: #fff; background-color: #dc8100 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TxFunc is a function that can be wrapped in a transaction | |
type TxFunc func(tx *sql.Tx) error | |
// WithTx wraps a function in an sql transaction. After the function returns, the transaction is | |
// committed if there's no error, or rolled back if there is one. | |
func WithTx(db *sql.DB, f TxFunc) (err error) { | |
tx, err := db.Begin() | |
if err != nil { | |
return err | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style> | |
* {margin: 0; padding: 0;} | |
body { text-align: center; } | |
#ascii { font-family: monospace; font-size: 11px; line-height: 70%; } | |
#sprite { display: none; } | |
#container { overflow: hidden; display: inline-block; } | |
</style> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
#set -x | |
if [ "$(uname)" == "Darwin" ]; then | |
echo "macOS install coming soon" | |
exit 1 | |
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then | |
echo "Starting linux install" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from __future__ import print_function | |
"""Minimal API documentation generation.""" | |
#------------------------------------------------------------------------------ | |
# Imports | |
#------------------------------------------------------------------------------ | |
import inspect |
NewerOlder