Skip to content

Instantly share code, notes, and snippets.

View rodorgas's full-sized avatar
🧑‍💻
Typing…

Rodrigo Orem rodorgas

🧑‍💻
Typing…
View GitHub Profile
# Path to your oh-my-zsh installation.
export ZSH=/Users/rodrigoorem/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Uncomment the following line to use case-sensitive completion.
@rodorgas
rodorgas / bmp2template.py
Created April 2, 2017 08:19
Script to generate an template to reddit.com/place
import sys
from PIL import Image
class Template:
COLOR_MAP = {
(255, 255, 255): 0,
(228, 228, 228): 1,
(136, 136, 136): 2,
(34, 34, 34): 3,
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
3 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 3
3 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 3
3 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 3
3 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 8 8 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 3
3 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 8 8 8 8 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 3
3 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 1
@rodorgas
rodorgas / gist:1ebef07ef8135e3b81746e0a52218f2b
Created December 30, 2017 17:57
Change referer to Facebook
javascript:location.href='http://facebook.com/l.php?u='+encodeURIComponent(location.href)
@rodorgas
rodorgas / program.c
Created March 2, 2018 11:19
Prova MAC
#include <stdio.h>
#include <string.h>
const char grupos[10][5] = {"", "", "abc", "def", "ghi", "jkl",
"mno", "pqrs", "tuv", "wxyz"};
void gerarPalavra(int number[], int curr_digit, char output[], int n)
{
int i;
if (curr_digit == n)
{

funções da stl

queue

push(x) no final da fila, pop(x), front(x) retorna o valor do 1o. elemento da fila, size(), empty()

queue<int> q;
q.push(1);
print(q.front());
q.pop();

Programação dinâmica 2

Guardar informações na memória para não ter que fazer uma computação muitas vezes.

int fib(int i) {
    if (i == 1 || i == 0) return 1;
    return fib(i-1) + fib(i-1);
}
// Toca alarme quando a fila atingir os valores abaixo:
let limites = [310000, 100000, 50000, 10000, 1000];
// Define intervalo de verificação em segundos
let intervalo = 30;
function alarm() {
var audio = new Audio('https://linux.ime.usp.br/~orem/alarme.mp3');
audio.play();
}
# remap prefix from 'C-b' to 'C-x'
unbind C-b
set-option -g prefix C-x
bind-key C-x send-prefix
# ctrl-a (not the prefix, but after) to go to last window
bind-key C-a last-window
# hot conf reload
bind r source-file ~/.tmux.conf