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
| import { and, type DBQueryConfig, eq, type SQLWrapper } from "drizzle-orm"; | |
| import { drizzle } from "drizzle-orm/postgres-js"; | |
| import postgres, { type Sql } from "postgres"; | |
| import { type AnyArgs } from "@/common"; | |
| import { | |
| type DbClient, | |
| type DbTable, | |
| type DeleteArgs, |
I use pandoc to convert masses of Word documents to markdown. Still working on a generic script, but for now here's the "gist" of what I type into the terminal:
$ myfilename="example"
$ pandoc \
-t markdown_strict \
--extract-media='./attachments/$myfilename' \
$myfilename.docx \Learning without thought is labor lost; thought without learning is perilous.
— Confucius
Programmer ninjas of the past used these tricks to sharpen the mind of code maintainers.
Code review gurus look for them in test tasks.
Novice developers sometimes use them even better than programmer ninjas.
Read them carefully and find out who you are – a ninja, a novice, or maybe a code reviewer?
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
| /** | |
| * The dining philosophers implementation of Node.js | |
| * | |
| * See also: | |
| * http://rust-lang-ja.github.io/the-rust-programming-language-ja/1.6/book/dining-philosophers.html | |
| * | |
| * (c) 2018 Leko | |
| */ | |
| const cluster = require('cluster') |
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
| 'use strict'; | |
| const crypto = require('crypto'); | |
| const ENC_KEY = "bf3c199c2470cb477d907b1e0917c17b"; // set random encryption key | |
| const IV = "5183666c72eec9e4"; // set random initialisation vector | |
| // ENC_KEY and IV can be generated as crypto.randomBytes(32).toString('hex'); | |
| const phrase = "who let the dogs out"; | |
| var encrypt = ((val) => { |
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
| A blood black nothingness began to spin. | |
| Began to spin. | |
| Let's move on to system. | |
| System. | |
| Feel that in your body. |
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
| // Today, I noticed that someone favorited this tweet of mine from 2012: | |
| // https://twitter.com/cowboy/status/232587756486938624 | |
| // !function $(){console.log('!'+$+'()')}() #quine | |
| // So I fooled around for a little bit: | |
| // Shortest JavaScript quine? | |
| (function _(){return'('+_+')()'})() | |
| // Have fun with this one! |
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 | |
| #create our key pairs | |
| openssl genrsa -out private.pem 2048 | |
| openssl rsa -in private.pem -pubout -out public.pem | |
| #sign and verify | |
| openssl dgst -sha1 -sign private.pem -out "$0".sha1 $0 | |
| openssl dgst -sha1 -verify public.pem -signature "$0".sha1 $0 |
NewerOlder