Skip to content

Instantly share code, notes, and snippets.

@shazow
shazow / gc_debug.py
Created April 4, 2017 17:22
Debug Python memory leaks
collections.Counter(str(type(obj)) for obj in gc.get_objects())
@shazow
shazow / .config
Created March 2, 2018 17:53
shazowic-corvus kernel build: thinkpad x1 carbon 6th gen (not perfect yet)
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 4.15.7-gentoo-r1 Kernel Configuration
#
#
# Gentoo Linux
#
CONFIG_GENTOO_LINUX=y
CONFIG_GENTOO_LINUX_UDEV=y
@shazow
shazow / ThinkpadX1Carbon6thgen.md
Last active September 15, 2022 15:38
Thinkpad X1 Carbon 6th gen configs

Configs

/etc/conf.d/*: ...

Modules

/etc/modprobe.d/i915.conf:

options i915 enable_guc_loading=1 enable_guc_submission=1 enable_fbc=1 enable_psr=1

My i3-related configs

$HOME/.config/i3/config:

# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
@shazow
shazow / terminal_indent_breakage.go
Last active April 26, 2019 20:31
Demonstrating a rendering bug
/*
Bug screenshot: https://tmp.shazow.net/screenshots/screenshot_2019-04-26_dd60.png
Output paste:
$ go run *.go
echo: "test"
echo: "foo"
echo: "bar"
echo: "😼"
echo: "why do emojis break the echo indent?"
echo: ""
// Using github.com/gomodule/redigo v2.0.0+incompatible
func TestMiniRedisScan(t *testing.T) {
/*
redis> ZADD idx 0 "ccc"
(integer) 1
redis> ZRANGEBYLEX idx "[d" "[e"
(empty list or set)
redis> ZRANGEBYLEX idx "[c" "[d"
1) "ccc"
*/
package main
import (
"context"
"fmt"
"os"
"time"
"github.com/gdamore/tcell"
)
@shazow
shazow / main.go
Created August 17, 2020 15:03
Bleve partial word search example
package main
import (
"fmt"
"log"
"github.com/blevesearch/bleve"
)
func main() {
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
✅ did:3:bafyreif5cgttygibnalhnupkypppjalanfkip7vdyoit3hojhgs5tsh7im ✅
Create your profile today to start building social connection and trust online at https://3Box.io/
@shazow
shazow / flashbotnfts.ts
Last active May 26, 2023 01:20
WIP: Flashbot NFTs
import { BigNumber, providers, Wallet } from "https://esm.sh/ethers";
import { FlashbotsBundleProvider, FlashbotsBundleResolution } from "https://esm.sh/@flashbots/ethers-provider-bundle";
const FLASHBOTS_AUTH_KEY = Deno.env.get('FLASHBOTS_AUTH_KEY');
const WALLET_PRIVATE_KEY = Deno.env.get('WALLET_PRIVATE_KEY');
const GWEI = BigNumber.from(10).pow(9);
const PRIORITY_FEE = GWEI.mul(3);
const LEGACY_GAS_PRICE = GWEI.mul(12);
const BLOCKS_IN_THE_FUTURE = 2;