Coding Maxims
updated list moved to https://grin.io/coding-maxims
[color] | |
diff = auto | |
status = auto | |
branch = auto | |
ui = auto | |
[core] | |
autocrlf = input | |
safecrlf = true | |
pager = cat | |
[alias] |
<!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> |
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)}(); |
// 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); | |
} |
<!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 } |
// 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 | |
} |
<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> |
#!/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" |
updated list moved to https://grin.io/coding-maxims
# -*- coding: utf-8 -*- | |
from __future__ import print_function | |
"""Minimal API documentation generation.""" | |
#------------------------------------------------------------------------------ | |
# Imports | |
#------------------------------------------------------------------------------ | |
import inspect |