Skip to content

Instantly share code, notes, and snippets.

Avatar
👁️
Eating glass and staring into the abyss

Ramon Saraiva ramonsaraiva

👁️
Eating glass and staring into the abyss
View GitHub Profile
View gen_mem_poc.py
from memory_profiler import profile
def chunks_with_list(l):
return [
l[i:i + 100] for i in range(0, len(l), 100)
]
def chunks_with_gen(l):
View crush-input-gen.py
import random
N_MIN = 3
N_MAX = pow(10, 7) # 10e7
M_MIN = 1
M_MAX = 2 * pow(10, 5) # 2 * 10e5
K_MIN = 0
K_MAX = pow(10, 9) # 10e9
AB_MIN = 1
AB_MAX = N_MAX
View .vimrc
filetype plugin indent on
language en_US
set noswapfile
" line numbers
set relativenumber
" tab as spaces
set tabstop=4
View vim.c
#ifndef VMS
/*
* Wait "msec" msec until a character is available from file descriptor "fd".
* "msec" == 0 will check for characters once.
* "msec" == -1 will block until a character is available.
* When a GUI is being used, this will not be used for input -- webb
* Returns also, when a request from Sniff is waiting -- toni.
* Or when a Linux GPM mouse event is waiting.
*/
#if defined(__BEOS__)