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
# CLI | |
sudo apt update -y | |
sudo apt install -y \ | |
git curl docker.io \ | |
build-essential pkg-config autoconf bison rustc cargo clang \ | |
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \ | |
libvips imagemagick libmagickwand-dev \ | |
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \ | |
rbenv apache2-utils |
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
// Credits to Louistiti from Drizzle Discord: https://discord.com/channels/1043890932593987624/1130802621750448160/1143083373535973406 | |
import { sql } from "drizzle-orm"; | |
const clearDb = async (): Promise<void> => { | |
const query = sql<string>`SELECT table_name | |
FROM information_schema.tables | |
WHERE table_schema = 'public' | |
AND table_type = 'BASE TABLE'; | |
`; |
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
/* list of order */ | |
create table "order" ( | |
id text primary key, | |
created_at timestamp with time zone default current_timestamp, | |
processed_at timestamp with time zone, | |
processed_state text | |
); | |
/* processed transition on order.id */ | |
create table order_events ( |
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
# Given a user containing a `first_name` and a `last_name` methods, write a `handle` | |
# method that returns a generated handle that follow the following rules: | |
# - It must be preceded by an @ | |
# - It must be all lowercase | |
# - It contains the first letter of the first name, and all the letters of the last | |
# name (for "John" "Doe", it'd be @jdoe) | |
# - If the first name contains more than one name, get the first letter of each name | |
# ("John Fitzgerald Wood" "Doe" becomes @jfwdoe) | |
# - If the last name contains more than one name, get all the letters of the last one, | |
# and the first letter of each other ("John" "Fitzgerald Wood Doe" becomes @jfwdoe) |
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
" replace 'function' with λ | |
au BufNewFile,BufRead *.js syntax keyword javasScriptFunction function conceal cchar=λ | |
au BufNewFile,BufRead *.js hi! link javasScriptFunction Conceal | |
au BufNewFile,BufRead *.js setlocal conceallevel=2 | |
" add abbreviations for JS | |
" f_ | |
" expands to | |
" function() { | |
" <cursor> | |
" |
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
// See comments below. | |
// This code sample and justification brought to you by | |
// Isaac Z. Schlueter, aka isaacs | |
// standard style | |
var a = "ape", | |
b = "bat", | |
c = "cat", | |
d = "dog", |