Skip to content

Instantly share code, notes, and snippets.

@jdvfx
jdvfx / Piantor-Keyboard-_42-keys_.kbd.json
Last active April 17, 2024 06:17 — forked from Lenbok/Crkbd-Keyboard.kbd.json
Piantor Keyboard [42 keys]
[
{
"name": "Piantor Keyboard [42 keys]",
"switchMount": "Choc",
"switchBrand": "Kailh",
"switchType": "White",
"plate": true
},
[
{
@valyala
valyala / README.md
Last active April 18, 2024 13:51
Optimizing postgresql table for more than 100K inserts per second

Optimizing postgresql table for more than 100K inserts per second

  • Create UNLOGGED table. This reduces the amount of data written to persistent storage by up to 2x.
  • Set WITH (autovacuum_enabled=false) on the table. This saves CPU time and IO bandwidth on useless vacuuming of the table (since we never DELETE or UPDATE the table).
  • Insert rows with COPY FROM STDIN. This is the fastest possible approach to insert rows into table.
  • Minimize the number of indexes in the table, since they slow down inserts. Usually an index on time timestamp with time zone is enough.
  • Add synchronous_commit = off to postgresql.conf.
  • Use table inheritance for fast removal of old data:
@ssskip
ssskip / ISO3166-1.alpha2.json
Last active April 18, 2024 13:51
json of country codes (ISO 3166-1 alpha-2) and corresponding names
{
"AF": "Afghanistan",
"AX": "Aland Islands",
"AL": "Albania",
"DZ": "Algeria",
"AS": "American Samoa",
"AD": "Andorra",
"AO": "Angola",
"AI": "Anguilla",
"AQ": "Antarctica",
@dteoh
dteoh / command.md
Created September 15, 2021 00:26
Interactively delete git branches locally

Delete multiple Git branches with a UI

This assumes you have installed [fzf][1].

$ git branch --no-color | fzf -m | xargs -I {} git branch -D '{}'

Press tab to mark a branch, shift-tab to unmark. Press enter and all marked branches will be deleted.

@bonface221
bonface221 / index.html
Created April 18, 2024 13:49
EMBED youtube without showing all the options
<iframe
src="https://www.youtube.com/embed/BYN_cVnP4fc?autoplay=1&mute=1&playsinline=1&loop=1&playlist=BYN_cVnP4fc&controls=0&disablekb=1"
frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen>
</iframe>
Put this code below in a file called example_report.Rmd
---
title: "Report for `r params$country`"
date: "`r format(Sys.time(), '%d %B, %Y')`"
output:
tufte::tufte_handout:
latex_engine: xelatex
params:
country: "country"
@guest271314
guest271314 / harmony.md
Last active April 18, 2024 13:49
Why I use node, deno, bun, qjs, tjs at the same time

Why I use node, deno, bun, qjs, tjs at the same time.

Winds up being a (not the) rather comprehensive JavaScript toolbox. The idea being for the modern JavaScript programmer can use all of the tools available for a given requirement, task or job, without preference for any. No external bundlers or compilers are needed. No frameworks are needed. I can use qjs or tjs for systems with minimal RAM and disk space; and when I want to use Web API's deno makes an effort to provide those interfaces. In some cases I can run the exact same code in bun, deno, and node, which provides a means to perform 1:1 testing as to performance.

There's probably a few things I am unintentionally omitting below. These are just a brief synposis. I'll update accordingly.

@momota10s
momota10s / bibsample1.bib
Created January 30, 2015 11:30
TeXでWebサイトを参考した時のbibの書き方
@misc{soumu,
author = {総務省},
title = {平成25年通信利用動向調査の結果},
note = {\url{http://www.soumu.go.jp/menu_news/s-news/01tsushin02_02000072.html}},
year = {2014}
}
@qoomon
qoomon / conventional_commit_messages.md
Last active April 18, 2024 13:48
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

Put this code below in a file called example_report.Rmd
---
title: "Report for `r params$country`"
date: "`r format(Sys.time(), '%d %B, %Y')`"
output:
tufte::tufte_handout:
latex_engine: xelatex
params:
country: "country"