Skip to content

Instantly share code, notes, and snippets.

View haskellcamargo's full-sized avatar
🪲
Everything is terrible

Marcelo Camargo haskellcamargo

🪲
Everything is terrible
View GitHub Profile
import type { NodePath } from '@babel/traverse';
/**
* Finds dependencies of a declaration and removes the ones that are used exclusively
* by this declaration.
*
* NOTE: this only works for runtime bindings. Type bindings are excluded as I'd need to patch
* Babel to keep track of type bindings in the context of a declaration, and ain't nobody got
* time for that for now.
*
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" Nerdtree
Plugin 'scrooloose/nerdtree'
  • Introdução

    • Queremos um código
      • Legível
      • Reutilizável
      • Refatorável
  • Variáveis

    • Use nomes com significado
    • Use nomes pronunciáveis
  • Seja consistente na nomenclatura

@haskellcamargo
haskellcamargo / turing.v
Created January 16, 2019 20:10 — forked from casperbp/turing.v
Coq implementation of a Turing Machine
(*** Turing Machines in Coq *)
(** Some preliminary types we'll use *)
CoInductive CoList (A: Type) := CONS (a:A) (t:CoList A) | NIL.
Arguments CONS [A] _ _.
Arguments NIL [A].
CoInductive Delay A := HERE (a:A) | LATER (_:Delay A).
#ifdef __HARBOUR__
#include 'hbclass.ch'
#else
#include 'protheus.ch'
#endif
#define CRLF Chr( 13 ) + Chr( 10 )
#define OP_SELECT 1
#define OP_ORDER 2
module Graph = struct
type t = slot array array
and slot =
| Exist
| Empty
| Visited
exception Missing_vertex of int
#include 'hbclass.ch'
#define CRLF Chr( 13 ) + Chr( 10 )
External AllTrim
Class CTE
Hidden:
Data cTable
Data cIdField
@haskellcamargo
haskellcamargo / bitwise.c
Last active March 13, 2019 12:57
Math.pow
#include <stdio.h>
unsigned int mult_pow(int base, unsigned int exponent) {
unsigned int result = 1;
while (1) {
if (exponent % 2 != 0) {
result *= base;
}
exponent /= 2;
if (exponent == 0) {
#!/usr/bin/env bash
# ,
# / \,,_ .'|
# ,{{| /}}}}/_.' _____________________________________________
# }}}}` '{{' '. / \
# {{{{{ _ ;, \ / Ladies and Gentlemen, \
# ,}}}}}} /o`\ ` ;) | |
# {{{{{{ / ( | this is ... |
# }}}}}} | \ | |
# {{{{{{{{ \ \ | _____ __ .-_'''-. .---. .---. |
#include 'protheus.ch'
// ANSI/VT-100 sequences for console formatting
#define ANSI_BOLD Chr( 27 ) + '[1m'
#define ANSI_LIGHT_RED Chr( 27 ) + '[91m'
#define ANSI_LIGHT_GREEN Chr( 27 ) + '[92m'
#define ANSI_LIGHT_YELLOW Chr( 27 ) + '[93m'
#define ANSI_CYAN Chr( 27 ) + '[36m'
#define ANSI_LIGHT_GRAY Chr( 27 ) + '[37m'
#define ANSI_LIGHT_MAGENTA Chr( 27 ) + '[95m'