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
#!/bin/bash
# @author Marcelo Haskell Camargo
EMAIL_FILE=".email.auth"
PASSWD_FILE=".passwd.auth"
AUTH_FILE=".auth"
trap "rm -f $EMAIL_FILE; exit" SIGHUP SIGINT SIGTERM
trap "rm -f $PASSWD_FILE; exit" SIGHUP SIGINT SIGTERM
trap "rm -f $AUTH_FILE; exit" SIGHUP SIGINT SIGTERM
{
"name": "rung-client",
"version": "0.0.1",
"description": "Rung Client Desktop Linux x64",
"keywords": ["rung"],
"main": "https://app.rung.com.br/",
"window": {
"title": "Rung",
"icon": "rung.png",
"min_width": 700,
/**
* Groups a set of follow-up items based on:
* - Being a comment
* - Being the same author
* - The time difference between them in seconds is lesser than 30
*
* @author Celão Camargo
* @type [{ value :: String, id :: String, date :: String }] -> {homomorphic}
* @param {Array} items
* @return {Array}
/*{Protheus.doc} Download
Download de arquivo via HTTP (SOAP, REST)
@type function
@author Marcelo Camargo
@since 14/03/2016
@version P11/P12
@param oWebService, object, instância do webservice
@param cPath, string, caminho e nome do arquivo a fazer download
@param cFileName, string, nome do arquivo de saída
@[
Declare MaxAge: Nat Picture '99' := 100 { Max age to retrieve }
Declare Prop: Symbol := GENDER { Custom property to pick. Defaults to gender }
]
SELECT USER.NAME,
USER.EMAIL,
USER.@Prop
FROM dbo.TB_USERS
WHERE USER.AGE > @MaxAge
{
var checkDuplication = function (list) {
var found = [];
list.forEach(function (item) {
if (found.indexOf(item.name) !== -1) {
throw new Error('Field `' + item.name + "' declared twice");
}
found.push(item.name);
});
set nocompatible
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
set rtp+=/usr/local/lib/python2.7/dist-packages/powerline/bindings/vim/
" Always show statusline
set laststatus=2
public static boolean isPalindorme(String word) {
int ahead = 0;
int behind = word.length - 1;
while (behind > ahead) {
if (word[ahead] != word[behind]) { return false; }
ahead++; behind--;
}
return true;
MarxDown
= FuncCall
/ Ident
FuncCall "function call"
= invoke:Ident _ '(' _ expr:MarxDown _ ')' {
return {
type: 'FuncCall',
value: {
call: invoke,
@haskellcamargo
haskellcamargo / BasicArithmetic.hs
Created October 23, 2016 13:24
Very basic natural arithmetic
module Main where
-- Written by Marcelo Camargo <[email protected]> on
-- Sat Oct 22 2016
-- Represent natural numbers
data ℕ = Zero
| Succ ℕ
inc ∷ ℕ → ℕ
inc = Succ