Skip to content

Instantly share code, notes, and snippets.

View vijfhoek's full-sized avatar

Sijmen vijfhoek

View GitHub Profile
from typing import Tuple
def rule_0(s: str) -> Tuple[bool, str]:
r = s
valid_0, r = rule_8(r)
valid_1, r = rule_11(r)
if all((
valid_0,
valid_1,
)):
from typing import Tuple
def rule_11(s: str) -> Tuple[bool, str]:
r = s
valid_0, r = rule_42(r)
valid_1, r = rule_31(r)
if all((
valid_0,
valid_1,
)):
@vijfhoek
vijfhoek / aerc-segv.txt
Created August 21, 2020 22:19
Segfault aerc
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x559c3629d49b]
goroutine 1 [running]:
git.sr.ht/~sircmpwn/aerc/widgets.(*MessageList).Draw(0xc0000b5500, 0xc000b338c0)
git.sr.ht/~sircmpwn/aerc/widgets/msglist.go:112 +0x2cb
git.sr.ht/~sircmpwn/aerc/lib/ui.(*Grid).Draw(0xc0000d4630, 0xc000b33830)
git.sr.ht/~sircmpwn/aerc/lib/ui/grid.go:142 +0x257
git.sr.ht/~sircmpwn/aerc/widgets.(*AccountView).Draw(0xc0001c2000, 0xc000b33830)
git.sr.ht/~sircmpwn/aerc/widgets/account.go:142 +0x3b
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <tree_sitter/api.h>
#include <tree_sitter/highlight.h>
TSLanguage *tree_sitter_c();
int main() {
// Create a parser.
@vijfhoek
vijfhoek / fix_telegram.md
Last active November 7, 2016 18:15 — forked from afogal/fix_telegram_bubbles.md
How to fix the really really round telegram bubbles and << >> -- stuff

Here is a GDB script to fix it (tested on GNU/Linux only):

 tbreak _ZN3App9initMediaEv
 commands
     set {char}_ZN3App9msgRadiusEv=0xB8
     set {int}(_ZN3App9msgRadiusEv+1)=3
     set {char}(_ZN3App9msgRadiusEv+5)=0xC3
     set {char}_Z25replaceStringWithEntitiesRK13QLatin1String5QCharR7QStringP5QListI12EntityInTextEb = 0xC3
 end

run

Keybase proof

I hereby claim:

  • I am sijmenschoon on github.
  • I am vijfhoek (https://keybase.io/vijfhoek) on keybase.
  • I have a public key whose fingerprint is 76DE 0896 0D85 7CB7 F786 EFD0 47D2 2F4C DEBF 6D16

To claim this, I am signing this object:

@vijfhoek
vijfhoek / test.java
Last active September 16, 2015 22:44
class LolThisIsAVeryLongClassName
extends AnotherExtremelyLongClassName {
public static int HelloWorld(String a,
String b, String c, String d,
String e, String f) {
System.out.println("Hello " + a + b
+ c + " world " + d + e + f +
"!");
}
[vijfhoek@sijmen-laptop Algorithms]$ python shuntingyard.py 1
['1']
[vijfhoek@sijmen-laptop Algorithms]$ python shuntingyard.py 1+5
['1', '5', '+']
[vijfhoek@sijmen-laptop Algorithms]$ python shuntingyard.py 1+5*3
['1', '5', '3', '*', '+']
[vijfhoek@sijmen-laptop Algorithms]$ python shuntingyard.py 1*5+3
['1', '5', '*', '3', '+']
[vijfhoek@sijmen-laptop Algorithms]$ python shuntingyard.py 3X+5
['3', 'X', '*', '5', '+']

Keybase proof

I hereby claim:

  • I am Vijfhoek on github.
  • I am vijfhoek (https://keybase.io/vijfhoek) on keybase.
  • I have a public key whose fingerprint is 56BB DEAA C87E 2673 CAE8 242D 30E0 279F FE13 745A

To claim this, I am signing this object:

namespace Z80
{
public partial class HD44780 : UserControl
{
#region font
private byte[,] font = new byte[256,8] {
/* 01 */ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // cgram 0
/* 00 */ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // cgram 1
/* 02 */ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // cgram 2
/* 03 */ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // cgram 3