Skip to content

Instantly share code, notes, and snippets.

@gnaggnoyil
gnaggnoyil / SMBDIS.ASM
Created January 23, 2018 03:43 — forked from 1wErt3r/SMBDIS.ASM
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@gnaggnoyil
gnaggnoyil / .gitconfig
Created June 7, 2018 02:36 — forked from shawndumas/.gitconfig
Using WinMerge as the git Diff/Merge Tool on Windows 64bit
[mergetool]
prompt = false
keepBackup = false
keepTemporaries = false
[merge]
tool = winmerge
[mergetool "winmerge"]
name = WinMerge

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

TrueColor対応ターミナル沢志保

kitazawa

curl -L https://git.io/vhaOt

最近のターミナルエミュレータでは256色だけでなく、16ミリオン色表示することが可能ですがテスターとしてただ色がついたブロックを表示するのはあまりにもつまらないのでアイドルファイト北沢志保を表示させることで使っているターミナルが対応しているかどうか確認できるテスターをつくりました。

Windowsのmintty(wsltty)とmacOSのiTermで動作確認済みです。

@gnaggnoyil
gnaggnoyil / Printf.idr
Created August 8, 2018 13:52 — forked from chrisdone/Printf.idr
Type-safe dependently-typed printf in Idris
module Printf
%default total
-- Formatting AST.
data Format
= FInt Format
| FString Format
| FOther Char Format
| FEnd
@gnaggnoyil
gnaggnoyil / specification.md
Created October 14, 2018 07:46 — forked from rain-1/dcs.rkt
Dotted Canonical S-expressions - DCSexps

Dotted Canonical S-expressions - DCSexps

This is a specification for an s-expression interchange format that attempts to improve upon [2]rivest's canonical s-expressions.

It is an output format for a subset of s-expressions. Those containing only pairs and atoms.

It was designed with the following desirable properties in mind:

  • It has the canonicity property that (EQUAL? A B) implies the DCS output of A is byte equal to the DCS output of B.
  • It has the non-escaping property that arbitrary binary blobs can be contained as atoms without any processing. A consequence of this is that dcsexps can be nested easily.
@gnaggnoyil
gnaggnoyil / ngrok-selfhosting-setup.md
Created June 22, 2019 20:00 — forked from lyoshenka/ngrok-selfhosting-setup.md
How to setup Ngrok with a self-signed SSL cert

Intro

The plan is to create a pair of executables (ngrok and ngrokd) that are connected with a self-signed SSL cert. Since the client and server executables are paired, you won't be able to use any other ngrok to connect to this ngrokd, and vice versa.

DNS

Add two DNS records: one for the base domain and one for the wildcard domain. For example, if your base domain is domain.com, you'll need a record for that and for *.domain.com.

Different Operating Systems

@gnaggnoyil
gnaggnoyil / parse_date.h
Created November 19, 2019 06:33 — forked from qis/parse_date.h
Parse ISO 8601 date time strings in C++ and AVX2.
// if(MSVC)
// set(AVX2_FLAGS "/arch:AVX2")
// else()
// set(AVX2_FLAGS "-march=native -mavx2")
// endif()
//
// option(ENABLE_AVX2 "Enable AVX2 support" OFF)
// if(ENABLE_AVX2)
// if(CMAKE_CROSSCOMPILING)
// set(AVX2 TRUE)
@gnaggnoyil
gnaggnoyil / sudo.bat
Created March 7, 2020 12:48 — forked from liyafe1997/sudo.bat
sudo for Windows, save as sudo.bat put in C:\Windows then you can sudo lol. Powershell see https://gist.github.com/liyafe1997/93be39df5ffee18a1c14a24122576e15
@echo off
powershell -Command "(($arg='/k cd /d '+$pwd+' && %*') -and (Start-Process cmd -Verb RunAs -ArgumentList $arg))| Out-Null"
@echo on
@gnaggnoyil
gnaggnoyil / sudo.ps1
Created March 7, 2020 12:48 — forked from liyafe1997/sudo.ps1
sudo.ps1, sudo for PowerShell, put in C:\Windows then you can sudo in powershell lol. You need sudo.bat(https://gist.github.com/liyafe1997/e036a7c3d4fb3903d567ec6d62c324ef)
If($args){sudo.bat powershell -NoExit -Command "(cd "$pwd");("$args")"}Else{sudo.bat powershell -NoExit -Command "cd "$pwd}