This file contains hidden or 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 | |
# == USAGE == | |
# Put Github URLs inside a file called `plugins.start.txt` inside your vim | |
# directory (either `$HOME/.vim/plugins.start.txt` or | |
# `$HOME/.config/nvim/plugins.start.txt`). Then, run this script which will | |
# clone or update the plugins accordingly. | |
# | |
# == EXAMPLE == | |
# $ cat "$HOME/.config/nvim/plugins.start.txt" |
This file contains hidden or 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
func (v V_APPLICATIONS) View(dialect string) sq.Query { | |
USERS := sq.New[USERS]("u") | |
USER_ROLES := sq.New[USER_ROLES]("ur") | |
USER_ROLES_APPLICANTS := sq.New[USER_ROLES_APPLICANTS]("ura") | |
PERIODS := sq.New[PERIODS]("p") | |
FORMS := sq.New[FORMS]("f") | |
APPLICATIONS := sq.New[APPLICATIONS]("a") | |
applicants := NewCTE("applicants", nil, Postgres. | |
Select( |
This file contains hidden or 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
// https://go.dev/play/p/BT-OUMK5Rtp | |
package main | |
import ( | |
"fmt" | |
) | |
// Deref will dereference a generic pointer. | |
// It will fail at compile time if pt is not a pointer. |
This file contains hidden or 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
// https://play.golang.org/p/UPn9o_AMpmr | |
package main | |
import ( | |
"fmt" | |
"golang.org/x/crypto/salsa20" | |
) | |
var key = [32]byte{} |
This file contains hidden or 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
1) Summon baby villager that grows up in a few seconds | |
/summon villager ~ ~ ~ {Age:-100} | |
2) Summon baby villager that doesn't grow up (for a very long time) | |
/summon villager ~ ~ ~ {Age:-2147483648} |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
type Foo struct { | |
User string `tag_name:"tag 1"` | |
Fruit string `tag_name:"tag 2"` |
This file contains hidden or 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
-- how to model threaded comments (e.g. reddit comments) in SQL with a simple 'ancestors' column | |
-- The comment tree: | |
-- [1] | |
-- / \ | |
-- [2] [4] | |
-- / \ \ | |
-- [3] [7] [6] | |
-- / | |
-- [5] |
This file contains hidden or 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
wget -O /dev/null http://speedtest-ams2.digitalocean.com/100mb.test |
This file contains hidden or 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
<!-- Copied from https://codepen.io/PerfectIsShit/pen/zogMXP --> | |
<!-- made into a gist in case the codepen goes down --> | |
<h2>HTML5 File Upload Progress Bar Tutorial</h2> | |
<form id="upload_form" enctype="multipart/form-data" method="post"> | |
<input type="file" name="file1" id="file1" onchange="uploadFile()"><br> | |
<progress id="progressBar" value="0" max="100" style="width:300px;"></progress> | |
<h3 id="status"></h3> | |
<p id="loaded_n_total"></p> | |
</form> | |
<script> |
This file contains hidden or 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
docker run -v "$PWD/schemaspy_output:/output" schemaspy/schemaspy:latest \ | |
-t pgsql \ | |
-host host.docker.internal \ | |
-port 5432 \ | |
-db my_database \ | |
-u my_username \ | |
-p my_password \ | |
-vizjs | |
# -host needs to be host.docker.internal to refer to your local machine's localhost, | |
# not the schemaspy container's localhost. Schemaspy's docker documentation for this is horrible. |