Skip to content

Instantly share code, notes, and snippets.

View rbrito's full-sized avatar
☹️
Having (YET another) kidney stone surgery in a few days...

Rogério Brito rbrito

☹️
Having (YET another) kidney stone surgery in a few days...
View GitHub Profile
@IBBoard
IBBoard / MediterraneanNightExtras.css
Created April 12, 2014 16:00
MediterraneanNight extras for Gnome 3.12
/** Extra rules by IBBoard to get nicer GTK3 header bars **/
/* Also requires https://gist.github.com/Dvad/9210763 */
.header-bar .button, .header-bar .button:last-child {
background-image: linear-gradient(to bottom,
shade(@theme_bg_dark_color, 1.40),
shade(@theme_bg_dark_color, 1.10));
color: @theme_text_dark_color;
box-shadow: inset 0px 4px alpha(#000, 0.02),
inset 0px 3px alpha(#000, 0.02),
#!/usr/bin/python
import socket, ssl, select, time, re
from thread import start_new_thread
from struct import pack
TYPE_ENUM = 0
TYPE_STRING = 2
TYPE_BYTES = TYPE_STRING
def clean(s):
@rosinality
rosinality / mathology.html
Created January 23, 2015 07:34
Very simple latex sketchpad
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Mathology</title>
<style>
body {
font-family: Arial, Helvetica, sans-serif;
}
@HandyMenny
HandyMenny / zram_combined_benchmark
Last active October 13, 2021 17:05
zram benchmark
~ # /tmp/zramtest3.sh test6 /tmp/ffmpeg-1\:2.6.1-1-x86_64.pkg.tar
zram test6 Sat Apr 4 09:50:06 GMT 2015
comp_algorithm [lzo] lz4 snappy
real 0m 0.20s 0.20s 0.24s avg: 0.214s
real 0m 1.45s 1.42s 1.42s avg: 1.430s
compr_data_size 30504972 30504968 30504947 30504962
comp_algorithm lzo [lz4] snappy
@vlakoff
vlakoff / convert_lz4_header.php
Last active August 13, 2021 23:17
Convert from Mozilla's LZ4 format to LZ4 v1.3
<?php
/**
* Convert from Mozilla's LZ4 format to LZ4 v1.3
*
* @link https://searchfox.org/mozilla-central/source/toolkit/components/lz4/lz4.js
* @link https://lz4.software.informer.com/1.3/
*
* @param string $input File content in Mozilla's LZ4 format
* @return string File content converted to LZ4 v1.3
@bishboria
bishboria / springer-free-maths-books.md
Last active April 25, 2024 06:27
Springer made a bunch of books available for free, these were the direct links
@CMCDragonkai
CMCDragonkai / memory_layout.md
Last active April 28, 2024 18:50
Linux: Understanding the Memory Layout of Linux Executables

Understanding the Memory Layout of Linux Executables

Required tools for playing around with memory:

  • hexdump
  • objdump
  • readelf
  • xxd
  • gcore
@meagtan
meagtan / galois.c
Last active May 2, 2023 08:53
Quick implementation of Galois fields
/*
* The following is an implementation of the finite field GF(2^8) as bit vectors of length 8, where the nth bit represents the
* coefficient of the nth power of the generator in each element, and the generator satisfies the minimal polynomial
* x^8 + x^4 + x ^3 + x^2 + 1 in the prime field Z_2, in which addition is equivalent to XOR and multiplication to AND.
* The elements of GF(2^8) thus represent polynomials of degree < 8 in the generator x. Addition in this field is simply
* bitwise XOR, but multiplication requires the elimination of powers of x <= 8.
*/
#include <stdio.h>
#include <stdint.h>
@otsaloma
otsaloma / remove-duplicate-subs
Last active June 25, 2017 22:37
Remove duplicate subtitles with aeidon
#!/usr/bin/env python3
import aeidon, sys, time
if len(sys.argv) < 2:
print("Usage: {} SUBTITLE_FILE...".format(__file__))
raise SystemExit(1)
for fname in sys.argv[1:]:
print("{}:".format(fname))
project = aeidon.Project()
project.open_main(fname, "utf_8")
before = len(project.subtitles)
@agentcooper
agentcooper / 0.README.md
Last active April 9, 2024 19:27
Telegram chat backup/export

How to use

  1. Login to https://web.telegram.org
  2. Copy-paste contents of telegram-scripts.js into JS console
  3. Run showContacts() to get the list of contacts with ids
  4. Run saveChat(userId) where userId is the id from step 3

Process can take a while, check console for progress. Occasionall FLOOD_WAIT errors are expected. Once done, browser will download the JSON file.

Motivation