Skip to content

Instantly share code, notes, and snippets.

@MatheusFaria
MatheusFaria / bitmask.h
Created November 21, 2018 17:54
32 Bitmask helper
#include <iostream>
class Bitmask {
public:
Bitmask(uint32_t _=0u) : n(_) {}
inline uint32_t get(int i) const { return (n >> i) & 1; }
inline void set (int i) { n |= (1 << i); }
inline void reset(int i) { n &= ~(1 << i); }
@MatheusFaria
MatheusFaria / naiveedgedetection_sobel.shader
Created June 3, 2018 02:01
Unity edge detection using sobel filter naive implementation
Shader "matheusfaria/EdgeDetectionSobel"
{
Properties
{
_MainTex ("Base (RGB)", 2D) = "white" {}
_Threshold ("Threshold", Range(0, 1)) = 1
}
Category
{
@MatheusFaria
MatheusFaria / naiveblur.shader
Last active June 2, 2018 18:37
Unity Naive Blur Shader (This shader is slow!!!)
Shader "matheusfaria/NaiveBlur"
{
Properties
{
_MainTex ("Base (RGB)", 2D) = "white" {}
_Radius ("Blur Radius", Int) = 3
}
Category
{
@MatheusFaria
MatheusFaria / gdb-eda.md
Created August 22, 2017 20:49
Prática com o GDB

Prática com o GDB

Para executar o programa recursao.c :

$ make recursao
$ gdb ./recursao

Assim que executar o gdb, ele abrirá um terminal especial onde você pode inspecionar

APC

Material de apoio a disciplina de Algoritmos e Programação de Computadores da UnB - FGA

Moodle da disciplina.

Ambiente

  • Sistema Operacional: Ubuntu
  • Compilador: gcc (já vem por padrão no ubuntu)
@MatheusFaria
MatheusFaria / pokedex_ascii.h
Last active October 23, 2024 07:00
151 Pokemon ASCII Art
/**
* The ASCII arts were extracted from:
* - http://www.fiikus.net/?pokedex
* - http://www.world-of-nintendo.com/pictures/text/
* And also generated with:
* - http://www.text-image.com
*/
#ifndef __POKE_IMG__
#define __POKE_IMG__
@MatheusFaria
MatheusFaria / GenerateDays.py
Created March 2, 2017 23:34
Generate the days given a start, an end, and the weekdays that should be considered
from datetime import timedelta
from datetime import date
one_day = timedelta(days=1)
today = date.today()
start_day = date(today.year, 3, 6)
end_day = date(today.year, 7, 17)
# Moday is 0 - Sunday is 6
@MatheusFaria
MatheusFaria / tempfile.py
Created February 1, 2017 16:52
Creates an editable temp file that will be removed on close
import os
class TempFile(object):
"""Creates an editable temp file that will be removed on close"""
def __init__(self, *args, **kwds):
self.args = args
self.kwds = kwds
def __enter__(self):
#!/bin/bash
# You must run with bash
#function nyan
#{
e='\033'
RESET="$e[0m"
BOLD="$e[1m"
CYAN="$e[0;96m"

Virtual Box Guest Addtions pre-requiriments

For some one how is going to use the virtual box of Cent OS 6.4, and want to install the guest addtions