Skip to content

Instantly share code, notes, and snippets.

View DrSensor's full-sized avatar

૮༼⚆︿⚆༽つ DrSensor

View GitHub Profile
@DrSensor
DrSensor / Advanced Markdown Tricks.md
Last active March 30, 2024 22:51
Advanced Markdown Tricks

Repository

What Will I Learn?

In general, you will learn some markdown tricks combined with standard HTML tags. In more details what you will learn:

  • Hide-show content
  • Writing codeblocks inside codeblocks
  • Combining and using italic, bold, superscript, subscript, and/or strikethrough
  • Quoting long sentence (using nested blockquotes)
@DrSensor
DrSensor / desktop.nix
Last active December 25, 2023 19:52
My plan for full migration into NixOS and Wayland
{ pkgs ? import <nixpkgs>
, lib ? pkgs.lib
, desktopEnvironment
}: with pkgs;
desktopEnvironment {
session-manager = emptty;
window-manager = [ sway labwc ];
screen-display = {
use = kanshi; # autorandr
gui = wlay;
@DrSensor
DrSensor / esptool.md
Created November 18, 2018 22:00
ESP Troubleshooting 101
$ esptool.py chip_id
esptool.py v2.5.1
Found 1 serial ports
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
MAC: 84:f3:eb:0b:dd:53
import tweepy, json, time, sys
auth = tweepy.OAuth1UserHandler(
<api keys here>
)
api = tweepy.API(auth)
d = json.loads(open(sys.argv[1]).read().split("=", 1)[1])
@DrSensor
DrSensor / README.md
Last active November 15, 2022 03:36
Weekend Project

code related to parallelization

  • main.ts - main logic that both run on main thread and each of worker thread
  • utils.ts

code related to visualization

@DrSensor
DrSensor / .gitconfig
Last active March 9, 2022 15:53
Git Tricks
[alias]
rescue = !git fsck --full --no-reflogs --unreachable --lost-found | grep commit | cut -d\\ -f3 | xargs -n 1 git log -n 1 --pretty=oneline > .git/lost-found.txt
ignore = !files={$(echo \"$@\" | tr ' ' ,)}.gitignore && echo '<-' github:$files && curl -sL https://raw.githubusercontent.com/github/gitignore/master/$files >> .gitignore && echo '->' .gitignore || echo FAIL && :
license-osi = !curl -sL https://raw.githubusercontent.com/OpenSourceOrg/licenses/master/texts/plain/$1 > LICENSE
license = !curl -sL https://raw.githubusercontent.com/github/choosealicense.com/gh-pages/_licenses/$1.txt > LICENSE
fork = !git clone $1 $3 --depth 1 && pushd ${3:-$(basename $1 .git)} > /dev/null && git remote add upstream $(git remote get-url origin) && git remote set-url origin $2 && popd > /dev/null && :
modlink = !pushd $1 && repo=$(git remote get-url origin) && popd && git submodule add $repo $2 && rm $2 && ln -s $1 $2 && :
first-commit = !git log $(git rev-list
@DrSensor
DrSensor / utils.go
Last active October 11, 2021 08:03
Questionable Snippets
// Copyright 2021 Fahmi Akbar Wildana <~drsensor/public-inbox@lists.sr.ht>
// SPDX-License-Identifier: FSFAP
package utils
import (
"path/filepath"
"sort"
"strings"
)
@DrSensor
DrSensor / package.jsonc
Last active June 25, 2021 11:38
Useful dependencies for GameDev
{
"dependencies": {
"canvas-recorder": "*", // record <canvas> then bundle as .zip
"cannon-es": "*", // tree-shakable physics engine! (finally😂)
},
"devDependencies": {
"madge": "*", // visualize your dependencies graph
},
}
# with sound and file
gst-launch-1.0 uridecodebin uri=file:///home/dirk/Videos/Clouds_67_Timelapse.mp4 ! video/x-raw,width=1280,height=720 ! queue ! x264enc threads=0 bitrate=400 tune=zerolatency key-int-max=30 ! queue ! flvmux name=flvmux ! queue ! rtmpsink location=rtmp://live-fra.twitch.tv/app/$APIKEY audiotestsrc ! faac ! flvmux.
@DrSensor
DrSensor / glitch-screen.sh
Created November 18, 2020 21:46
My Lockscreen
#!bin/sh
maim -x $1 \
| convert png:- bmp:- \
| sox -r 48k -c 1 -e u-law -t raw /dev/stdin -t raw /dev/stdout trim 0 100s \
: treble -30 1k \
| convert bmp:- rgb:- \
| i3lock --image /dev/stdin --raw 1920x1080:rgb
# Other terms: Glitchart, Databender, Obfuscate Image