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
@haskellcamargo
haskellcamargo / SQLSelectGrammar.pegjs
Created August 26, 2015 14:19
SQL Select Grammar
/**
* Grammar for validating simple SQL selects.
* @author Marcelo Camargo
* @since 2015/08/26
*/
{
var Sql = {
listToString: function(x, xs) {
return [x].concat(xs).join("");
@haskellcamargo
haskellcamargo / checkls-1.0.ls
Created February 25, 2015 19:12
checkls-1.0.ls
window.add-event-listener(\load, (!->
container = document.create-element \div
container.id = \check-results-container
ul = document.create-element \ul
ul.id = \check-results
container.append-child ul
container |> document.body.append-child ), false)
check-assert = (value, desc) !->
container = document.get-element-by-id \check-results
@haskellcamargo
haskellcamargo / testing.hs
Created February 25, 2015 21:39
Tests with Rawr Lang
module Data where
with (~Closure, ~Countable, ~Exception, ~ReflectionClass) do
("../Data.Types.php" :: File).requireOnce!
class ClassHolder(className :: Str)
with contract Countable
my publicMethods :: Int <- 0
my methods :: [~ReflectionMethod] <- [||]
@haskellcamargo
haskellcamargo / enterprise.pas
Created February 25, 2015 22:33
Trabalho da faculdade
program Enterprise;
{*
@date : 11/19/2014
@authors : Marcelo Camargo,
Eduardo Tell.
@compiler: Free Pascal.
*}
/** Consider the interface
interface Mappable<A> {
map: (A → B) → Mappable<B>
}
*/
function Identity(value) {
@haskellcamargo
haskellcamargo / Prelude.hb
Last active August 29, 2015 14:16
Harbour Prelude
/**
* This file is responsible by the preprocessor definitions and macros for
* work on syntax.
* @lastmod: 2015-03-13
* @author : Marcelo Haskell Camargo
*/
// Range syntax: @{ nStart .. nEnd }
#xtranslate @{ <nStart> .. <nEnd> } => Z_Range( <nStart>, <nEnd> );
// Range syntax with step: @{ nStart, nNext .. nEnd }
@haskellcamargo
haskellcamargo / IO.php
Last active August 29, 2015 14:17
xBase Docgen
<?php
# Copyleft (C) Marcelo Camargo.
try {
# First we verify if we already have a directory to store our docs.
if (!is_dir("functions"))
mkdir("functions");
# Samples sources are stored inside functions folder
if (!is_dir("functions/samples"))
mkdir("functions/samples");
{
"cmd": ["java", "-jar", "C:\/TOTVS\/command_line_tools\/tdscli.jar", "-help"],
"encoding": "cp1252",
"variants": [
{
"cmd": ["java", "-jar", "C:\/TOTVS\/command_line_tools\/tdscli.jar", "compile",
"program=$file", "includes=C:\/ambientes_protheus\/M118_SQA_VALID2\/include",
"server=localhost", "port=25006", "environment=M118_SQA_VALID2", "serverType=Advpl",
"user=admin", "psw=",
@haskellcamargo
haskellcamargo / ajudaAPDA.c
Last active August 29, 2015 14:17
Ajuda APDA
/**
* @author: Marcelo Camargo
* @license: GNU/GPL v3
* @description: 1 + 1/2! + 1/3! ... 1/n!
*/
#include <stdio.h>
#define EXIT_SUCCESS 0
// Trabalhamos de forma recursiva para obter o fatorial de um
@haskellcamargo
haskellcamargo / main.c
Last active August 29, 2015 14:17
Ajuda Programação e Computação
/**
*Bem, Luan, vamos analisar o seu código atual, certo?
*/
int main(int argc, char** argv) {
return 0;
char x;
printf("Digite um nome");
scanf("%c",&x);
}