Skip to content

Instantly share code, notes, and snippets.

View Drowze's full-sized avatar

R Gibim Drowze

View GitHub Profile
@Drowze
Drowze / gist:76a9b85372d168c8e013
Last active March 9, 2016 19:12
Podcasts I follow
--------- BRASILEIROS
Jogabilidade (games)
-> Esse feed abriga os podcasts sobre vídeo games do Jogabilidade. O DASH é temático e foca-se num jogo, série, desenvolvedor ou conceito a cada episódio. O Vértice é um compilado das mais recentes notícias e jogos que experimentamos. O Construindo Mundos entrevista e explora o lado humano dos desenvolvedores de games brasileiros.
http://feeds.feedburner.com/dashpodcast
Jogabilidade (não games)
-> Esse é o feed para os podcasts do Jogabilidade que não falam de vídeo games. O JACK é um podcast que discute anime e mangás num formato de "clube do livro". O Linha Quente é onde despejamos nossa (pouca) sabedoria sobre as mais diversas questões. No Fora da Caixa, recomendamos e discutimos todo o resto, de música a seriados, de filmes a canais de YouTube.
http://feeds.feedburner.com/jack-animeclub
@Drowze
Drowze / examinator.rb
Last active December 12, 2015 05:38
WIP: script to auto-correct almost any program (the outputs should not contain "\n\n" though)
## Converting line endings to unix:
inputs_file = File.open('./inputs.txt', 'a+')
outputs_file = File.open('./outputs.txt', 'a+')
input_file_contents = inputs_file.read.gsub(/\r\n?/,"\n")
inputs_file.truncate(0)
inputs_file.print input_file_contents
outputs_file_contents = outputs_file.read.gsub(/\r\n?/,"\n")
outputs_file.truncate(0)
Tempo (s) Pos (Y) V = at G (m/s^2) Variação Y
0 2500 0 -3.711
1 2498 -3.711 -3.711 -2
2 2493 -7.422 -3.711 -5
3 2483 -11.133 -3.711 -10
4 2470 -14.844 -3.711 -13
5 2454 -18.555 -3.711 -16
6 2433 -22.266 -3.711 -21
7 2409 -25.977 -3.711 -24
8 2381 -29.688 -3.711 -28
@Drowze
Drowze / mergesort.c
Last active December 4, 2015 05:11
#sort #sorting #puc apc-b 2016
#include <stdio.h>
void merge(int v[], int inicio, int meio, int fim) {
int aux[100];
int aux_inicio = inicio, aux_meio = meio + 1, k=0;
while(aux_inicio <= meio && aux_meio <= fim)
if(v[aux_inicio] <= v[aux_meio])
aux[k++] = v[aux_inicio++];
else
aux[k++] = v[aux_meio++];
@Drowze
Drowze / mim_ajuda.rb
Last active December 2, 2015 14:41
mim ajuda
require 'matrix'
class Matrix
def []=(i, j, x)
@rows[i][j] = x
end
end
class String # Only works for single letters; could be extended to uppercase letters too
def step(c, delta=1)
if c.ord + delta > 122 then
@Drowze
Drowze / caesar.c
Last active November 11, 2015 17:18
Only simple letters for now
#include <stdio.h>
void caesar_cipher(FILE *input, FILE *output, int k){
int ch;
k %= 26; //26 indica uma volta completa, logo qualquer k>26 é excessivo
do{
ch = fgetc(input);
if(ch >= 65 && ch <= 90) { //letra maiuscula? (valores de 'A' e 'Z' da tabela ASCII)
ch += k;
if(ch > 90)
@Drowze
Drowze / Compress_individual_files.txt
Created November 3, 2015 11:49
Compress all files in a folder into individual 7z files
FOR %i IN (*.*) DO 7z.exe a -m0=LZMA2 -mmt=x "%~ni.7z" "%i"
where x = number of cores
10
6 1 3 4 5 0 7 3 1 9
8 1 3 4 5 9 7 2 9 2
3 2 8 4 5 1 7 1 6 3
1 9 3 4 5 6 7 9 5 3
2 7 4 4 5 2 7 0 2 1
6 2 9 4 5 7 7 7 3 2
9 5 1 4 5 3 7 0 0 0
6 2 3 4 5 5 7 0 0 0
1 2 2 4 5 7 7 0 0 0
@Drowze
Drowze / funcoes.c
Created May 13, 2015 22:59
#estruturas_de_dados
no_musica *cria_musica(){
s_musica nova_musica;
printf("Digite o nome do artista: ");
__fpurge(stdin); fgets(nova_musica.artista, 32, stdin);
printf("Digite o titulo da faixa: ");
__fpurge(stdin); fgets(nova_musica.titulo, 32, stdin);
printf("Digite o genero da faixa: ");
__fpurge(stdin); fgets(nova_musica.genero, 32, stdin);
printf("Digite o ano da faixa: ");
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct s_aluno{
int ra;
char nome[52];
float nota;
struct s_aluno *prox;
};