Skip to content

Instantly share code, notes, and snippets.

View bguiz's full-sized avatar

Brendan Graetz bguiz

View GitHub Profile
@bguiz
bguiz / dont-lose-gnome-terminal-sessions-on-reboot.md
Last active February 11, 2023 22:04
Ensures that you don't lose your gnome-terminal windows when you crash/ reboot Linux

Usage

  • create and alias/ symlink for the file, I use 'watcher.sh' in my home directory
  • when you fire up a gnome-terminal
    • enter ~/watcher.sh and leave that tab running in the background
  • when you crash and reboot, and fire up a gnome-terminal
    • enter ~/watcher.sh restore to restore all your windows and tabs that you previously had open, and it will cotninue watching automatically after that is done

Problem that it solves

@bguiz
bguiz / svg-9slice-scaling.svg
Created January 20, 2015 05:18
svg 9-slice scaling - +chrome + firefox -ie
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bguiz
bguiz / book.pdf
Last active February 7, 2021 03:39
tex-overlay-text-on-graphics
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bguiz
bguiz / yubi_gpg.sh
Created October 6, 2020 09:30 — forked from luisfontes19/yubi_gpg.sh
Yubikey GPG config
#!/bin/zsh
##
## This automation was created to be used with MACOS based on the instructions from drduh
## (https://github.com/drduh/YubiKey-Guide)
##
## You need to install gpg first:
## brew install gnupg hopenpgp-tools ykman pinentry-mac
## and GPG Suite can also come in handy (https://gpgtools.org/)
##
// web3 provider with fallback for old version
window.addEventListener('load', async () => {
// New web3 provider
if (window.ethereum) {
window.web3 = new Web3(ethereum);
try {
// ask user for permission
await ethereum.enable();
// user approved permission
{"id": "0d593b03242553b24568b3dbccceadd8cb419795091f6e75267f37d8e6100771c10b3bd55285eae9adc99c3e1b0a770f152e132c20c8425b94d43c7d65fc36a9"}
@bguiz
bguiz / .block
Last active September 28, 2018 03:08
license: gpl-3.0
height: 700
border: no

Why

  • You want to do a minor edit to files on another branch
  • The copy of the git repo that you have locally is in a state that is too much effort to clean up/ revert/ stash etc to bother

How

  • simply clone the repo in a different folder
  • but this clone is minimal, so it's much faster
> 0b11111111111111110000000000000000 - 0b100000000000000000
4294770688
> ((0xffff - 2) * 0x10000)
4294770688
> ((0xffff - 2) << 16)
-196608 # WHY??>?
> ((0xffff - 2) << 16) >>> 0
4294770688
@bguiz
bguiz / README.md
Last active August 22, 2017 13:04
Custom NodeJs REPL

Custom NodeJs REPLs

A way to create read-eval-print-loops for your own projects, with a per-instance history, rather than a global history.

Sample Usage