Skip to content

Instantly share code, notes, and snippets.

@lucassouza1
lucassouza1 / ActivitiService.php
Created July 2, 2011 10:33
Activiti Rest Client PHP
<?php
class ActivitiService{
const BASE_URL = 'http://localhost:8080/activiti-rest/service/';
const ADMIN_USERNAME = 'kermit';
private $_services = array(
'processDefinitions' => 'process-definitions',
'processDefinition' => 'process-definition/',
@lucassouza1
lucassouza1 / gist:4128744
Created November 22, 2012 00:47
Class coffee
Class PedidoFacade
setTotalPedido: ($pedido_id) ->
CaixaFacade.setEnvVarCaixa()
$total = PedidoDAO.getTotalPedido($pedido_id)
$totalpago = PedidoDAO.getTotalPagoPedido($pedido_id)
$diff = $total - $totalpago
tk_set_env_var("total_pedido", $diff)
salvaPagamentoPedido: () ->
CaixaFacade.setEnvVarCaixa()
@lucassouza1
lucassouza1 / gist:4135502
Created November 23, 2012 12:57
Site crawler
(ns receitacrawler.sites.tudogostoso.crawler
(:require [net.cgrand.enlive-html :as html])
(:use [cheshire.core :only [generate-string]]))
(def base-url "http://tudogostoso.uol.com.br")
(def title-selector [:.page-title :h1])
(def ingredients-selector [:.ingredients :.recipelist :li :span])
(def image-url-selector [:.photo])
(:use [ring.util.codec :only [url-encode]])
(def utmac "MO-XXXXXXXX-X") ;; Use MO instead of UA
(defn- new-uuid []
(java.util.UUID/randomUUID))
(defn md5
"Generate a md5 checksum for the given string"
[token]
@lucassouza1
lucassouza1 / gist:46835b6d32de7ef45a93
Created August 6, 2014 23:26
Processamento de dados de Cotas Parlamentares
// Total de gastos por deputado por período
/*
Exemplo de documento
{
"_id" : ObjectId("53e2a0ae0364c1ab82d44333"),
"nome" : "ACÁCIO JÚNIOR (53a Legislatura)",
"deputado-id" : "2034",
"despesas" : [
{
"mes-ano" : NumberLong(2011001),
#!/usr/bin/env python -*- coding: utf-8 -*-
import os
import time
import re
import urllib
#import urllib.request
import json
import argparse
import sys
@lucassouza1
lucassouza1 / index.html
Created June 24, 2016 18:15
Parameters
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Parameters</title>
<style>
body {
display: flex;
flex-direction: column;
font-family: monospace;