Skip to content

Instantly share code, notes, and snippets.

Fahmi Akbar Wildana DrSensor

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am drsensor on github.
  • I am drsensor (https://keybase.io/drsensor) on keybase.
  • I have a public key ASDvtxSiUu0YOZr4V4IxnJd-33IA4SawWjw-F6oAh1Yx6Ao

To claim this, I am signing this object:

View hacktoberfest-raspistrate.md

Cross compiling notes

1st attempt 2019-10-15

$ cross build --target x86_64-unknown-linux-gnu --release --package substrate
.
.
error: failed to run custom build command for `librocksdb-sys v5.18.3`
Caused by:
  process didn't exit successfully: `/target/release/build/librocksdb-sys-e17ed1a83908e9ac/build-script-build` (exit code: 101)
@DrSensor
DrSensor / test.md
Last active Jun 2, 2019
Advanced HTML tags in Markdown
View test.md

H2O

mc2

collapsible
const working = burnout
@DrSensor
DrSensor / bug.py
Last active Feb 19, 2019
Bug In Programming language
View bug.py
# Expression in Literal String Interpolation (pep-0498/#supporting-full-python-expressions)
fixtures = []
a1 = f"'{'\' \''.join(fixtures)}'"
a2 = f"'{"' '".join(fixtures)}'"
# only on Python 3.5.3
a3 = f"({'|'.join(fixtures)})"
a4 = f'" "{f} '.join(fixtures)
View Rollup config tricks.md

Globbing rollup input

In my case, I use it to bundle CLI app that use oclif which also act (and can be used) as a library.

Setup
npm i -D globby
Config
import {sync as glob} from "globby"
@DrSensor
DrSensor / EventListener.d.ts
Created Dec 22, 2018 — forked from rsms/EventListener.d.ts
Better EventEmitter TypeScript interface
View EventListener.d.ts
export class EventEmitter<Events, K = keyof Events|symbol> {
addListener(event: K, listener: (...args: any[]) => void): this;
on(event: K, listener: (...args: any[]) => void): this;
once(event: K, listener: (...args: any[]) => void): this;
removeListener(event: K, listener: (...args: any[]) => void): this;
removeAllListeners(event?: K): this;
setMaxListeners(n: number): this;
getMaxListeners(): number;
listeners(event: K): Function[];
emit(event: K, ...args: any[]): boolean;
@DrSensor
DrSensor / esptool.md
Created Nov 18, 2018
ESP Troubleshooting 101
View esptool.md
$ 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
@DrSensor
DrSensor / markdown.json5
Last active Oct 4, 2018
My VSCode Snippet
View markdown.json5
{
// Place your snippets for markdown here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"subscript": {
"prefix": "sub",
"body": [
"<sub>$1</sub>"
@DrSensor
DrSensor / git-notes.md
Last active Sep 19, 2018
Git Dark Magic
View git-notes.md

Motivation

Hide some nasty stuff 💩 in Github

Placing magic notes on dark file

  1. Get the commit hash on specific commit
$ git log --all --grep='search_string' --pretty='format:%h'

5125aee
You can’t perform that action at this time.