Skip to content

Instantly share code, notes, and snippets.

View prepare-commit-msg
#!/usr/bin/env python3
# copy me into $repository_root/.git/hooks/
import os
import sys
import typing as T
from pathlib import Path
from subprocess import PIPE, run
BRANCHES_TO_SKIP: T.List[str] = os.environ.get(
"BRANCHES_TO_SKIP", "master staging develop test production"
@rr-
rr- / shiina-rio-unpack
Created Oct 27, 2015
Shiina Rio .exe decoder
View shiina-rio-unpack
#!/bin/python3
import struct
import argparse
# tested on:
# - Sorcery Jokers (works)
# - Tekoire Princess (needs manual tweaks to work)
# so it's only semi-automatic.
def read_u16(data, offset):
View gist:74d246112ed517f889ee
diff --git a/src/keymap.cc b/src/keymap.cc
index a2df529..fe0d969 100644
--- a/src/keymap.cc
+++ b/src/keymap.cc
@@ -98,6 +98,8 @@ static const struct _vte_keymap_entry _vte_keymap_GDK_space[] = {
};
static const struct _vte_keymap_entry _vte_keymap_GDK_Tab[] = {
+ /* Ctrl+Tab */
+ {cursor_all, keypad_all, GDK_CONTROL_MASK, _VTE_CAP_CSI "I", -1},
@rr-
rr- / gist:4056c97c8d045487ad41
Created Oct 1, 2014
Example of tokenizer for PHP
View gist:4056c97c8d045487ad41
<?php
namespace Tokenizer;
class Token
{
public $type;
public $content;
}
$tokenList =
@rr-
rr- / TextCaseConverter.php
Last active Aug 29, 2015
Convert text between popular capitalization standards
View TextCaseConverter.php
<?php
class TextCaseConverter
{
const SNAKE_CASE = 1; //snake_case
const SPINAL_CASE = 2; //spinal-case
const TRAIN_CASE = 3; //Train-Case
const UPPER_CAMEL_CASE = 5; //CamelCase
const LOWER_CAMEL_CASE = 6; //camelCase
const CAMEL_CASE = self::UPPER_CAMEL_CASE; //CamelCase
const BLANK_CASE = 7; //blank case
@rr-
rr- / EmailObfuscator.php
Last active Dec 26, 2015
E-mail anti-spam protection using Javascript/PHP obfuscation.
View EmailObfuscator.php
<?php
class EmailObfuscator
{
public static function embedJavascript($x, $justPlainText = false)
{
$seed = mt_rand(0, 10000);
$x = str_split($x);
//permutation
$a = 0;