-
Split every character:
"something".split(/(?!^)/)
-
Never split:
"something".split(/^.$/)
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
# Requires git and docker | |
# clone bitwarden_rs | |
git clone https://github.com/dani-garcia/bitwarden_rs | |
cd bitwarden_rs | |
# Use rust docker container to build everything | |
docker run --rm -it -v `pwd`:/bitwarden rust bash | |
# Download pi tools and openssl |
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
flags: {} | |
packages: | |
- . | |
extra-deps: | |
- language-glsl-0.3.0@sha256:85c1e7bf2cf5d6e604b7a2899c27e2935033425944db200798e57849e64d4c81 | |
- time-1.9.2@sha256:874e07fb970531b9dcd814f74e00f253ce2f22ccd8272a6c4c137ee9040237fb | |
resolver: lts-12.14 |
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
-- Get size of database | |
SELECT pg_size_pretty(pg_database_size('database-name')); | |
-- Set the current session as read only | |
SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY; | |
-- Locks | |
-- https://www.postgresql.org/docs/10/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS | |
SELECT pg_try_advisory_lock(123123213123) as lockObtained; |
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
-- type 'go' to execute the block | |
-- List all tables | |
1> select * from information_schema.tables; | |
-- Describe table | |
1> exec sp_columns table_name; |
- Clone
elm/compiler
- Install stack
- Install required version of cabal using
stack --resolver lts-9 install cabal-install
(commercialhaskell/stack#3453 (comment)) PATH=~/.local/bin:$PATH stack init --solver
to install the required version of GHCPATH=~/.local/bin:$PATH stack build --flag elm:dev
to build
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 to automatically create a user_id column for new tables with name starting with user_ | |
create or replace function create_user_id_column() | |
returns event_trigger | |
language plpgsql volatile as | |
$$ | |
declare | |
obj record; | |
identity text[]; | |
begin | |
for obj in select * from pg_event_trigger_ddl_commands() |
CREATE TABLE users(
id serial not null primary key,
username text not null
);
CREATE TABLE tweets(
id serial not null primary key,
content jsonb default('{}')
);
I hereby claim:
- I am Checksum on github.
- I am checksum (https://keybase.io/checksum) on keybase.
- I have a public key whose fingerprint is EEA1 CD10 320D 497A B440 F6BD 45DD 4E24 58A5 101A
To claim this, I am signing this object:
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
import re | |
import markdown2 | |
class CustomMarkdown(markdown2.Markdown): | |
""" | |
Custom markdown processor that we use for task list | |
""" | |
reTaskList = re.compile(''' | |
(?P<prefix>[\r\n|\n|\r]*) |