Skip to content

Instantly share code, notes, and snippets.

@last=1;END{(@last<6) ? puts(6): ''}
@last.nil? ? puts((@last=2)-1): @last=2
(3-@last>1) ? puts((@last+=2)-1): @last=3
(4-@last>1) ? puts((@last+=2)-1): @last=4
(5-@last>1) ? puts((@last+=2)-1): @last=5
(6-@last>1) ? puts((@last+=2)-1): @last=6
@shelvacu
shelvacu / diesel_composite_macro.rs
Last active August 21, 2019 17:37
Simple macro for making types to interface with postgres composite types in diesel.
// diesel_composite_macro.rs - Simple macro for making types to interface with postgres composite types in diesel.
// Written in 2019 by Shelvacu <shelvacu@gmail.com>
// To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
// You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
/// Columns **must** be in the same order as database
// based on https://github.com/diesel-rs/diesel/issues/1732
macro_rules! composite_type {
(
@shelvacu
shelvacu / Constitution.md
Created May 4, 2021 17:57
The CONstitution of the CONsortium

IN PROGRESS

The CONstitution of the CONsortium

Fungibles

Fungibles are indivisible units of currency that may be useful for other purposes.

Fungibles can not be created or destroyed.

@shelvacu
shelvacu / dl.sh
Created March 12, 2022 11:46
Just download all google ngrams eng 2020
for f in {1-000{00..23}-of-00024,2-{00000..00588}-of-00589,3-{00000..06880}-of-06881,4-{00000..06667}-of-06668,5-{00000..19422}-of-19423}.gz
do
if [ -f "$f" ]
then
echo "Skipping $f"
else
wget 'http://storage.googleapis.com/books/ngrams/books/20200217/eng/'$f || break
fi
done
@shelvacu
shelvacu / flake.lock
Last active April 10, 2024 20:32
simple bug repro for jovian-nixos
{
"nodes": {
"jovian": {
"inputs": {
"nix-github-actions": "nix-github-actions",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {