Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View schemar's full-sized avatar
😊

Martin Schenck schemar

😊
View GitHub Profile
@schemar
schemar / main.ts
Last active April 18, 2021 16:06
Test Plugin with MarkdowRenderChild in CodeBlock
import { MarkdownRenderChild, Plugin } from 'obsidian';
export default class Test extends Plugin {
async onload() {
console.log('loading plugin "test"');
this.registerMarkdownCodeBlockProcessor('testlang', async (_src, el, ctx) => {
ctx.addChild(new TestRenderChild(el));
});

Keybase proof

I hereby claim:

  • I am schemar on github.
  • I am schemar (https://keybase.io/schemar) on keybase.
  • I have a public key ASDp-urkJyGb5Y3rtlq_tER0c1pBkLj-6NzfkpvjYfjl5Qo

To claim this, I am signing this object:

@schemar
schemar / pre_calculate_contract_address.js
Last active April 3, 2023 09:21
Using web3 and RLP to pre-calculate an address that a contract will have after deployment. Based on address and nonce.
/*
* ==========
* TypeScript
* ==========
*/
const nonce = 6;
// Forcing type `any`, as web3 sha3 otherwise complains that it only accepts strings.
// `RLP.encode()` returns a `Buffer`.
// However, converting the buffer to a string first yields the wrong result. The buffer has to
@schemar
schemar / .tridactylrc
Created October 11, 2018 13:28
Dvorak friendly config of tridactyl
" bovine3dom's dogfood
" Provided only as an example.
" Do not install/run without reading through as you may be surprised by some
" of the settings.
" May require the latest beta builds.
" Move this to $XDG_CONFIG_DIR/tridactyl/tridactylrc (that's
" ~/.config/tridactyl/tridactylrc to mere mortals) or ~/.tridactylrc and
@schemar
schemar / config.py
Last active May 14, 2018 08:13
Dvorak friendly config for qutebrowser
# Autogenerated config.py
# Documentation:
# qute://help/configuring.html
# qute://help/settings.html
# ~/.config/qutebrowser/config.py on Linux
# ~/.qutebrowser/config.py on macOS
# %APPDATA%/qutebrowser/config.py on Windows
# Uncomment this to still load settings configured via autoconfig.yml
cd /
du -hsx * | sort -rh | head -10
# du command -h option : display sizes in human readable format (e.g., 1K, 234M, 2G).
# du command -s option : show only a total for each argument (summary).
# du command -x option : skip directories on different file systems.
# sort command -r option : reverse the result of comparisons.
# sort command -h option : compare human readable numbers. This is GNU sort specific option only.
# head command -10 OR -n 10 option : show the first 10 lines.
#############################################################
@schemar
schemar / runTests.sh
Last active August 29, 2015 14:06
Bash script to reset the database, load fixtures and run tests for Symfony with one call.
#!/bin/bash
function printHelp {
echo "Load fixtures and run tests"
echo "Usage: runTests.sh [options] [directory]"
echo ""
echo "Options:"
echo " -r|--reset resets the sqlite test database before testing"
echo " -h|--help print this help"
echo ""