1 | 2 | diff | wanted result |
---|---|---|---|
A | A | A | |
B | < B | ||
C | C | C | |
D | > 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
-- The args being numeric cause auto casting; This is what we want | |
-- e.g `COUNT(*)` returns a whole number but we often want to divide it to float | |
-- Postgres percent function | |
CREATE OR REPLACE FUNCTION percent(portion numeric, total numeric, round_level integer default 1) | |
RETURNS numeric | |
IMMUTABLE | |
RETURNS NULL ON NULL INPUT | |
PARALLEL SAFE | |
as $fbd$ |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#!/bin/bash | |
# move to `.git/hooks/pre-commit`; run `chmod +x .git/hooks/pre-commit` | |
set -e | |
files=$(git diff --staged --name-only --diff-filter=ACMRTUXB | grep '\.rb$' | tr '\\\n' ' ') | |
# Check we have files before trying to run the tests. | |
# Prevents getting stuck if we only update non .rb files. | |
if [[ -n $files ]];then | |
git diff --staged --name-only --diff-filter=ACMRTUXB | grep '\.rb$' | tr '\\\n' ' ' | xargs --no-run-if-empty bundle exec rubocop -A --config "$(git rev-parse --show-toplevel)/.rubocop.yml" |
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
\set QUIET 1 | |
\pset null '¤' | |
\set PROMPT1 '[%/] > ' | |
\set PROMPT2 '%R > ' | |
\timing | |
\x auto | |
\set VERBOSITY verbose |
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
ssh-ed25519-cert-v01@openssh.com AAAAIHNzaC1lZDI1NTE5LWNlcnQtdjAxQG9wZW5zc2guY29tAAAAILfZFL+Sc2QwVYljr+679F2u7l3dCt1W+yHpwKtfk31XAAAAIMWYZwqrMlekLqZnjCq5HA4OPuvRKMtBE7AAuB54McXBAAAAAAAAAAAAAAABAAAAIVNpZ25lZCBrZXkgZm9yIEdDIC0gRXhwOiBNYXIgMjAxOAAAAAgAAAAEYWRteAAAAABY1s8gAAAAAFqXQoAAAAAAAAAAggAAABVwZXJtaXQtWDExLWZvcndhcmRpbmcAAAAAAAAAF3Blcm1pdC1hZ2VudC1mb3J3YXJkaW5nAAAAAAAAABZwZXJtaXQtcG9ydC1mb3J3YXJkaW5nAAAAAAAAAApwZXJtaXQtcHR5AAAAAAAAAA5wZXJtaXQtdXNlci1yYwAAAAAAAAAAAAABFwAAAAdzc2gtcnNhAAAAAwEAAQAAAQEAtUbVYENqorKEn5Q78AqqLR90+T5zIA+NVz7jxuAO8/7eipFfK5UPzZMyObTGl1h/uas0TNcWQcn7vLkggYwMN2ssdjIvW0qMmoLkZq8Tu7lfEVQxxqM+YR93LWJJcIk0lOIdr3QvCD+1dZFQCqiu38RyDmaO09f5iVFUxXhnEx2zt0z/jQh3Xy7aEz9XEmvK6sfLhYkp6ViIvWWVLPJZgYKuoeDiNhHLrFiGqK9g+/Xx2HfCaqcvORcIUs0lYMauP4jOKaL4eEmKSAyAuZp0uSkfMKF2WG/X+IE8elCiBK59PKau34N8qvuhd2UBFpHzlVoIzA2+/UrGn/KXuHahiwAAAQ8AAAAHc3NoLXJzYQAAAQA1p3Jle8BkkFh/ruKL5ua19l8jf9ZTzb3+Re3+0gqfa7Rfxr8ADRdMI971BvmbeTROYprnxzOd32AepWjkvZtTP1KusePp+NKFpWkKkQeMx9eg7Cot0auU6vy5UVHQPGpqaPaCqpXfMz5whv6XP5Xxhzo |
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
// Provide string-matching based on fnmatch.3 | |
package fnmatch | |
// There are a few issues that I believe to be bugs, but this implementation is | |
// based as closely as possible on BSD fnmatch. These bugs are present in the | |
// source of BSD fnmatch, and so are replicated here. The issues are as follows: | |
// | |
// * FNM_PERIOD is no longer observed after the first * in a pattern | |
// This only applies to matches done with FNM_PATHNAME as well | |
// * FNM_PERIOD doesn't apply to ranges. According to the documentation, |
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
Verifying that +danielwakefield is my blockchain ID. https://onename.com/danielwakefield |
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
function preventBackspace() { | |
function matchesSelector_(el, selector) { | |
return (el.matches || el.msMatchesSelector).call(el, selector); | |
} | |
function prevent(e) { | |
if (e.which === 8) { // Backspace | |
if (!matchesSelector_(e.target, 'input:not([readonly]):not([type=radio]):not([type=checkbox]), textarea, [contentEditable], [contentEditable=true]')) { | |
e.preventDefault(); | |
} | |
} |
NewerOlder