Skip to content

Instantly share code, notes, and snippets.

Avatar

Rodrigo Silva MestreLion

  • Rio de Janeiro, Brazil
View GitHub Profile
@sigsegv-mvm
sigsegv-mvm / TEX_file_format.txt
Last active Oct 29, 2022
Reverse-engineered EXAPUNKS ".TEX" texture file format details
View TEX_file_format.txt
TEX FILE FORMAT
Reverse engineering by sigsegv, 20180914.
All values are little-endian.
0x00 int: TEX file version / magic number [1002 = 0x000003EA]
0x04 int: data resolution [x]
0x08 int: data resolution [y]
0x0C int: color format { 0 => invalid, 1 => 8BPP, 2 => RGBA }
0x10 int: display resolution [x]
@wafer-li
wafer-li / git_reset_mtime.py
Last active Jul 31, 2021
Restore file last modified time in a newly clone repo.Which base on the file's last commited time. Tested with python 3.4 and above
View git_reset_mtime.py
# -*- coding: utf-8 -*-
import subprocess
import os
import shlex
if __name__ != '__main__':
raise ImportError("%s should not be used as a module." % __name__)
# 'git ls-files -z | xargs -0 -n1 -I{} -- git log -1 --format="%ct {}" {} | sort'
@simivar
simivar / print_r_reverse.php
Last active Jun 18, 2022
PHP function to reverse print_r function
View print_r_reverse.php
<?php
/**
* I've published a fully-tested Composer library with type-casting.
* @see https://github.com/simivar/reverse-print-r
*/
/**
* Matt: core
* Trixor: object handling
* lech: Windows suppport
@mivade
mivade / cli.py
Last active Nov 18, 2022
Using a decorator to simplify subcommand creation with argparse
View cli.py
"""This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
View humble-downloader.py
from __future__ import print_function
import json
import sys
import re
import hashlib
from os import makedirs, path, remove
from getpass import getpass
from urlparse import urlparse
@konklone
konklone / ssl.rules
Last active Aug 3, 2022
nginx TLS / SSL configuration options for konklone.com
View ssl.rules
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email eric@konklone.com.
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {
@aperson
aperson / update_lwjgl.sh
Last active Dec 14, 2021
Updates the lwjgl that minecraft uses.
View update_lwjgl.sh
#!/usr/bin/env bash
echo "Determining OS..."
if [[ "$(uname -s)" == "Linux" ]]; then
mcdir="$HOME/.minecraft/"
downloader="wget --no-check-certificate -q -O"
os="linux"
natives="libjinput-linux libjinput-linux64 liblwjgl liblwjgl64 libopenal libopenal64"
elif [[ "$(uname -s)" == "Darwin" ]]; then
@cdown
cdown / gist:1163649
Last active Nov 11, 2022
Bash urlencode and urldecode
View gist:1163649
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in
@KevinGoodsell
KevinGoodsell / terminals.txt
Created Dec 17, 2010
The Trouble With Terminals
View terminals.txt
The Trouble With Terminals
Thu, 16 Dec 2010 16:43:20 -0800
Copyright 2010 Kevin Goodsell
0. License
This work is licensed under a Creative Commons
Attribution-NonCommercial-ShareAlike 3.0 Unported License. To view a