Skip to content

Instantly share code, notes, and snippets.

# Thanks to https://twitter.com/elijahmanor/status/1557003773272133632
alias fv="fd --type f --hidden --exclude .git | fzf-tmux -p --reverse | xargs nvim"
alias fkill="ps | fzf | cut -d\" \" -f1 | xargs kill -9"
@Enichan
Enichan / interpretoy.html
Last active December 16, 2021 21:38
Interpretoy: a toy lisp interpreter with REPL built in javascript
<html>
<head>
<title>Interpretoy REPL</title>
</head>
<body>
<script>
// based on lispy by Peter Norvig: http://norvig.com/lispy.html
function load(source) {
@suzaninfi
suzaninfi / List comprehensions.ipynb
Last active October 19, 2021 09:54
Python kennisdeling List Comprehensions
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@peerhenry
peerhenry / index.ts
Created October 4, 2021 13:16
Gekke type-shit in Typescript
// Gekke type-shit in Typescript
// duck typing
// interface IFoo {
// toString: () => string
// }
type ToStringable = { myToString: () => string }
function loggo<T extends ToStringable>(x: T) {
@davidfowl
davidfowl / MinimalAPIs.md
Last active April 29, 2026 16:47
Minimal APIs at a glance
@dadhi
dadhi / main.cs
Last active September 28, 2022 15:04
Discriminated Union (sum-type, co-product) from Algebraic Data Types (ADT) for C# which is memory efficient, supports one-line sub-typing
using System;
using System.Collections.Generic;
using static System.Console;
namespace Union
{
class Program
{
public static void Main()
{
@seidler2547
seidler2547 / convert_ha_sqlite2mysql.sh
Last active October 23, 2024 13:02
One-liner to convert an existing Home-Assistant SQLite database to MySQL
# prerequisites:
## install software
apt install mariadb-server libmariadbclient-dev sqlite3
## install mysqlclient in virtualenv
su -c 'homeassistant/bin/pip3 install mysqlclient --upgrade' -l homeassistant
## create database
mysql -e 'CREATE SCHEMA IF NOT EXISTS `hass_db` DEFAULT CHARACTER SET utf8'
## create user (use a safe password please)
mysql -e "CREATE USER 'hass_user'@'localhost' IDENTIFIED BY 'hass_pw'"
mysql -e "GRANT ALL PRIVILEGES ON hass_db.* TO 'hass_user'@'localhost'"
@duebbert
duebbert / msysgit2unix-socket.py
Last active June 18, 2025 13:45 — forked from kevinvalk/msysgit2unix-socket.py
Updated to better survive crashes and other unexpected behavior.
#!/usr/bin/python3
"""
msysGit to Unix socket proxy
============================
This small script is intended to help use msysGit sockets with the new Windows Linux Subsystem (aka Bash for Windows).
It was specifically designed to pass SSH keys from the KeeAgent module of KeePass secret management application to the
ssh utility running in the WSL (it only works with Linux sockets). However, my guess is that it will have uses for other
@shokinn
shokinn / .wsl_fix
Last active June 18, 2020 21:13
WSL - Use KeePass KeeAgent for SSH Keys; Use external X11
## Just source this file in your .$SHELLrc
# Import SSH-Keys from KeePass KeeAgent
# Enable msysgit socken in KeeAgent!
if [[ -z $SSH_AUTH_SOCK ]]; then
export SSH_AUTH_SOCK="/tmp/.ssh-auth-sock"
fi
if [[ ! -f /tmp/msysgit2unix-socket.pid ]]; then
~/bin/msysgit2unix-socket.py /mnt/c/Users/$USER/keeagent.sock:$SSH_AUTH_SOCK