Skip to content

Instantly share code, notes, and snippets.

@rutcreate
rutcreate / README.md
Last active December 5, 2025 10:17
Install Python 3.10.x on Ubuntu 20.04

Prerequisite

sudo apt update
sudo apt install software-properties-common -y

Add custom APT repository

@thecodingcod
thecodingcod / dbeaver_sqlcipher.md
Last active October 29, 2025 16:07
Setting up Dbeaver (The Universal DBMS) to work with SqlCipher Databases

Setting up Dbeaver (The Universal DBMS) to work with SqlCipher Databases

I’ve tried multiple solutions to browse SqlCipher Databases and the only one that seemed to work properly was [DB Sqlite Browser](DB Browser for SQLite (sqlitebrowser.org)) with easy GUI to get into the db. but … the overall experience of that application didn’t really satisfy me!

I knew DBeaver from long time ago, and i wondered if i can use it with SQLCipher, but it was surprisingly a shock that it doesn’t work directly, but with a couple of hours of researching and trying different methods i finally came up with a way to configure it Out-of-the box to make it work!

The reason I wrote this gist was to help others who have the same issue as it seems there is no guide to show how to do so!

@alyleite
alyleite / wsl.md
Last active July 1, 2025 10:55
Failed to connect to bus: Host is down - WSL 2

» sudo systemctl daemon-reload

System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down

==============================================

Edit*

  1. Open /etc/wsl.conf with any editor:
@CostasAK
CostasAK / one-dark-pro.json
Created February 22, 2021 14:35
Windows Terminal One Dark Pro
{
schemes: [
{
"name": "One Dark Pro",
"foreground": "#abb2bf",
"background": "#282c34",
"cursorColor": "#abb2bf",
"black": "#3f4451",
"red": "#e05561",
"green": "#8cc265",
@doggy8088
doggy8088 / WSLConfig.md
Created July 28, 2020 07:17
WSL 2 的 .wslconfig 設定檔說明
  • 編輯 %UserProfile%\.wslconfig 檔案

    • Command Prompt

      notepad %UserProfile%\.wslconfig
    • Windows PowerShell

@CatsMiaow
CatsMiaow / main.ts
Created June 12, 2020 05:26
Comlink example for Node.js with TypeScript
/**
* https://github.com/GoogleChromeLabs/comlink/blob/master/docs/examples/06-node-example/main.mjs
* https://github.com/GoogleChromeLabs/comlink/issues/476#issuecomment-642765445
* esModuleInterop to true in tsconfig.json compilerOptions.
*/
import { Worker } from 'worker_threads';
import * as comlink from 'comlink';
import nodeEndpoint from 'comlink/dist/umd/node-adapter';
import { cpus } from 'os';
@hamiltop
hamiltop / index.ts
Last active January 28, 2022 07:15
Example of Node, Typescript, and Comlink
import { getRemoteAPI } from "./my_worker";
async function init() {
console.time("launch");
const api = getRemoteAPI();
console.timeLog("launch");
console.time("first result");
console.timeLog("first result", await api.doMath());
console.time("second result");
console.timeLog("second result", await api.doMath());
@brandon93s
brandon93s / vs_code_context_menus.reg
Created October 8, 2017 19:39
Add context menu options for Visual Studio Code installed via scoop
Windows Registry Editor Version 5.00
; Open files
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
@="Edit with VS Code"
"Icon"="C:\\Users\\Brandon\\scoop\\apps\\vscode\\current\\Code.exe,0"
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
@="\"C:\\Users\\Brandon\\scoop\\apps\\vscode\\current\\Code.exe\" \"%1\""

Motivation

  • expression-oriented programming one of the great advances of FP
  • expressions plug together like legos, making more malleable programming experience in-the-small

Examples

Write in an expression-oriented style, scoping variables as locally as possible:

var div = document.querySelectorAll('div'),
result;
for (var i = 0; i < div.length; i++) {
result = div[i];
result.addEventListener('click', function() {
alert(this.innerHTML);
});
}