Skip to content

Instantly share code, notes, and snippets.

Avatar
🪲
Everything is terrible

Marcelo Camargo haskellcamargo

🪲
Everything is terrible
View GitHub Profile
View vimrc.vim
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" Nerdtree
Plugin 'scrooloose/nerdtree'
View solid.md
  • 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 Jan 16, 2019 — forked from casperbp/turing.v
Coq implementation of a Turing Machine
View turing.v
(*** 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).
View querybuilder.prw
#ifdef __HARBOUR__
#include 'hbclass.ch'
#else
#include 'protheus.ch'
#endif
#define CRLF Chr( 13 ) + Chr( 10 )
#define OP_SELECT 1
#define OP_ORDER 2
View gist:4cf9789ebe4e8393ddc05474d8d97be4
module Graph = struct
type t = slot array array
and slot =
| Exist
| Empty
| Visited
exception Missing_vertex of int
View cte.prg
#include 'hbclass.ch'
#define CRLF Chr( 13 ) + Chr( 10 )
External AllTrim
Class CTE
Hidden:
Data cTable
Data cIdField
View bitwise.c
#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) {
View run-tests.sh
#!/usr/bin/env bash
# ,
# / \,,_ .'|
# ,{{| /}}}}/_.' _____________________________________________
# }}}}` '{{' '. / \
# {{{{{ _ ;, \ / Ladies and Gentlemen, \
# ,}}}}}} /o`\ ` ;) | |
# {{{{{{ / ( | this is ... |
# }}}}}} | \ | |
# {{{{{{{{ \ \ | _____ __ .-_'''-. .---. .---. |
View logger.prw
#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'
View libcep.prw
#include 'protheus.ch'
Class Endereco
Data CEP As Character
Data Estado As Character
Data Cidade As Character
Data Bairro As Character
Data TipoLogradouro As Character
Data Logradouro As Character