-
Introdução
- Queremos um código
- Legível
- Reutilizável
- Refatorável
- Queremos um código
-
Variáveis
- Use nomes com significado
- Use nomes pronunciáveis
-
Seja consistente na nomenclatura
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
filetype off | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'VundleVim/Vundle.vim' | |
" Nerdtree | |
Plugin 'scrooloose/nerdtree' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(*** 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). | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef __HARBOUR__ | |
#include 'hbclass.ch' | |
#else | |
#include 'protheus.ch' | |
#endif | |
#define CRLF Chr( 13 ) + Chr( 10 ) | |
#define OP_SELECT 1 | |
#define OP_ORDER 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Graph = struct | |
type t = slot array array | |
and slot = | |
| Exist | |
| Empty | |
| Visited | |
exception Missing_vertex of int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include 'hbclass.ch' | |
#define CRLF Chr( 13 ) + Chr( 10 ) | |
External AllTrim | |
Class CTE | |
Hidden: | |
Data cTable | |
Data cIdField |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# , | |
# / \,,_ .'| | |
# ,{{| /}}}}/_.' _____________________________________________ | |
# }}}}` '{{' '. / \ | |
# {{{{{ _ ;, \ / Ladies and Gentlemen, \ | |
# ,}}}}}} /o`\ ` ;) | | | |
# {{{{{{ / ( | this is ... | | |
# }}}}}} | \ | | | |
# {{{{{{{{ \ \ | _____ __ .-_'''-. .---. .---. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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' |
NewerOlder