Skip to content

Instantly share code, notes, and snippets.

@yeetpy
yeetpy / README.md
Last active December 1, 2021 21:39
Python 3.6+ is required

yeet.py

A yeetifier for C/C++ code.

Usage:

  1. Select a C++ file:
// main.cpp
#include<iostream>
@iamgreaser
iamgreaser / gist:b1ebe6debc439b45c5fba074c3e34052
Last active April 15, 2021 19:30
THUG2 LZSS compression scheme (as used by the *.prx files)
THUG2 LZSS compression scheme (as used by the *.prx files)
Documented by GreaseMonkey in 2017
Document version V1
I release this document into the public domain.
AWWW YEAAAAH! Datz RIGHT b0!Z! We got a ... yeah whatever I'm not doing the
ASCII art required for that kind of introduction.
Well, they could've packed it a bit better, but hey, it took 50 minutes to
crack so I'm not complaining, and it is at least a decent compression scheme.
@cjaoude
cjaoude / gist:fd9910626629b53c4d25
Last active May 15, 2024 16:02
Test list of Valid and Invalid Email addresses
Use: for testing against email regex
ref: http://codefool.tumblr.com/post/15288874550/list-of-valid-and-invalid-email-addresses
List of Valid Email Addresses
email@example.com
firstname.lastname@example.com
email@subdomain.example.com
firstname+lastname@example.com
@romainl
romainl / gist:9970697
Last active March 21, 2024 09:00
How to use Tim Pope's Pathogen

How to use Tim Pope’s Pathogen

I’ll assume you are on Linux or Mac OSX. For Windows, replace ~/.vim/ with $HOME\vimfiles\ and forward slashes with backward slashes.

The idea

Vim plugins can be single scripts or collections of specialized scripts that you are supposed to put in “standard” locations under your ~/.vim/ directory. Syntax scripts go into ~/.vim/syntax/, plugin scripts go into ~/.vim/plugin, documentation goes into ~/.vim/doc/ and so on. That design can lead to a messy config where it quickly becomes hard to manage your plugins.

This is not the place to explain the technicalities behind Pathogen but the basic concept is quite straightforward: each plugin lives in its own directory under ~/.vim/bundle/, where each directory simulates the standard structure of your ~/.vim/ directory.

bind-key C-b send-prefix
bind-key C-o rotate-window
bind-key C-z suspend-client
bind-key Space next-layout
bind-key ! break-pane
bind-key " split-window
bind-key # list-buffers
bind-key $ command-prompt -I #S "rename-session '%%'"
bind-key % split-window -h
bind-key & confirm-before -p "kill-window #W? (y/n)" kill-window
# alias to edit commit messages without using rebase interactive
# example: git reword commithash message
reword = "!f() {\n GIT_SEQUENCE_EDITOR=\"sed -i 1s/^pick/reword/\" GIT_EDITOR=\"printf \\\"%s\\n\\\" \\\"$2\\\" >\" git rebase -i \"$1^\";\n git push -f;\n}; f"
# edit all commit messages
git rebase -i --root
# clone all your repos with gh cli tool
gh repo list --json name -q '.[].name' | xargs -n1 gh repo clone
@noahlz
noahlz / concajconsliststar.clj
Created May 3, 2013 15:49
concat vs. conj vs. cons vs. list vs. list*
user=> (concat '(1 2 3) '(4 5 6))
(1 2 3 4 5 6)
user=> (conj '(1 2 3) '(4 5 6))
((4 5 6) 1 2 3)
user=> (cons '(1 2 3) '(4 5 6))
((1 2 3) 4 5 6)
user=> (list '(1 2 3) '(4 5 6))
@1wErt3r
1wErt3r / SMBDIS.ASM
Created November 9, 2012 22:27
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
@tzbob
tzbob / gist:3959764
Created October 26, 2012 16:31
Micro TDD Prolog
% test predicate
test(Summary, Predicate) :-
string_concat('\n ', Summary, Buf),
string_concat(Buf, ' is running', Message),
write(Message),
call(Predicate),
write('\ndone.').
% example
force(anakin, 9).
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a