Skip to content

Instantly share code, notes, and snippets.

@mewmew
mewmew / ll.bnf
Last active January 16, 2024 15:38
A BNF grammar for LLVM IR assembly
// ### [ Lexical part ] ########################################################
_ascii_letter_upper
: 'A' - 'Z'
;
_ascii_letter_lower
: 'a' - 'z'
;

Ten seconds to ponder if a thread is worth it

recording

A userstyle that makes you wait ten seconds before entering a Hacker News thread. I use stylus to manage mine.

.subtext {
  display: inline-block;
 background: linear-gradient(to left, transparent 50%, #f60 50%) right;
@mewmew
mewmew / d.h
Created July 20, 2018 05:39
Type, variable and function declarations of DIABPSX.SYM (SLPS-01416).
typedef int bool;
enum _0fake {
MQ_BUTCHER = 1,
MQ_GARBUD = 2,
MQ_ZHAR = 4,
MQ_LTBANNER = 8,
MQ_VEIL = 16,
MQ_WARLORD = 32,
MQ_SKELKING = 64,
@mewmew
mewmew / gist:68a25a58fd70eab1384e6407357e05b3
Created July 9, 2022 11:14 — forked from alphazo/gist:3303282
Clone MiFare cards using chinesse UUID writable cards

libnfc supports UUID writable cards and even has some dedicated tools for them.

However it doesn't work with some of the cards found on eBay that are even simpler to use. Sector 0 is unlocked and can be written without any additional commands. libnfc requires a small patch to get it working.

Following has been tested under ArchLinux with modified libnfc 1.5.1, mfoc 0.10.2 and a SCL3711 dongle.

Patch & recompile libnfc

The patch is fairly simple, open libnfc-1.5.1/utils/nfc-mfclassic.c and comment 2 lines (it was lines 384 and 385 for me):

// Try to write the trailer

@mewmew
mewmew / unmarshal_interface.go
Created August 31, 2021 14:55 — forked from tkrajina/unmarshal_interface.go
Unmarshal JSON to specific interface implementation
package main
import (
"encoding/json"
"fmt"
"reflect"
)
type Something interface{}
@mewmew
mewmew / goclean.sh
Last active April 22, 2021 22:32 — forked from h12w/goclean.sh
#!/bin/bash
# The script does automatic checking on a Go package and its sub-packages, including:
# 1. gofmt (http://golang.org/cmd/gofmt/)
# 2. goimports (http://godoc.org/golang.org/x/tools/cmd/goimports)
# 3. golint (https://github.com/golang/lint)
# 4. go vet (http://golang.org/cmd/vet)
# 5. race detector (http://blog.golang.org/race-detector)
# 6. test coverage (http://blog.golang.org/cover)
@mewmew
mewmew / gist:18188e49df6926cf001b381a7927032d
Created April 16, 2021 09:05 — forked from BastienClement/gist:b34f14dd93381498a7a1
The CASC (Content Addressable Storage Container) Filesystem
---------------------------------------------------------------------
| The CASC (Content Addressable Storage Container) Filesystem |
| Warlords of Draenor Alpha, Build 6.0.1.18125 |
| Written April 14th, 2014 by Caali |
| Version 1.2 |
---------------------------------------------------------------------
Distribution and reproduction of this specification are allowed without
limitation, as long as it is not altered. Quotation in other works is
freely allowed, as long as the source and author of the quote are stated.
@mewmew
mewmew / d1_1775_funcs.txt
Last active February 8, 2021 20:25
List of 1,775 functions (91% complete)
0000002A -> GetErr
000000CE -> GetDDErr
00000831 -> GetDSErr
0000093A -> GetLastErr
00000947 -> TermMsg
00000975 -> MsgBox
000009C7 -> FreeDlg
00000A30 -> DrawDlg
00000A65 -> DDErrDlg
00000A88 -> DSErrDlg
@mewmew
mewmew / LearnGoIn5mins.md
Created January 5, 2021 17:50 — forked from prologic/LearnGoIn5mins.md
Learn Go in ~5mins
@mewmew
mewmew / delete_git_submodule.md
Created October 27, 2020 00:30 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule