Skip to content

Instantly share code, notes, and snippets.

Avatar

João Antonio Ferreira joao-parana

View GitHub Profile
View gist:4564314
var http = require('http');
var path = require('path');
var fs = require('fs');
var mimeTypes = {
'.js' : 'text/javascript',
'.html' : 'text/html',
'.css' : 'text/css'
};
@joao-parana
joao-parana / SomaConfig.java
Created May 21, 2013
Usando o MOXy no EclipseLink
View SomaConfig.java
package br.cepel.xml;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
import br.cepel.data.Plant;
import br.cepel.data.Queue;
@XmlRootElement
@joao-parana
joao-parana / Script-Astah-01.js
Last active Dec 18, 2015
Imprime nomes de classes e interfaces e respectivos atributos e métodos
View Script-Astah-01.js
importPackage(com.change_vision.jude.api.inf.model);
var classes = astah.findElements(IClass);
var rowData = [];
for(var i in classes) {
var clazz = classes[i];
rowData.push(clazz.getName());
// rowData.push(clazz.getOwner().getName());
rowData.push(clazz.getDefinition());
println(clazz);
View MyListenerAndMyEntityWithListener
package model.entity;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Id;
@Entity @EntityListeners(MyListener.class)
public class MyEntityWithListener {
@Id
private long id;
@joao-parana
joao-parana / metaphone.js
Last active Jan 22, 2021
Modulo YUI 3 para calculo fonético baseado no Algoritimo Metaphone
View metaphone.js
/***************************** COPYRIGHT NOTICES ***********************
Some of this code is based on metaphone.c file, which can be found here:
http://www2.varzeapaulista.sp.gov.br/metaphone/
The metaphone port is authored by Carlos Costa Jordao <carlosjordao@gmail.com>
and is covered under this copyright:
Copyright 2014, Carlos Costa Jordao <carlosjordao@gmail.com>.
All rights reserved.
@joao-parana
joao-parana / TesteMetaphone.html
Last active Jan 22, 2021
Teste de Módulo Metaphone
View TesteMetaphone.html
<!DOCTYPE html>
<html>
<head>
<!-- -->
<meta charset="UTF-8">
<title>Teste de Módulo Metaphone</title>
<!-- CSS: Alloy Bootstrap -->
<link href="http://cdn.alloyui.com/2.0.0/aui-css/css/bootstrap.min.css" rel="stylesheet">
<!-- O loader do AUI fica em /js/aui/aui e os diversos modulos em /js/aui -->
<script charset="utf8" src="http://cdn.alloyui.com/2.0.0/aui/aui-min.js"></script>
@joao-parana
joao-parana / USING-VAULT.md
Created Oct 2, 2015 — forked from voxxit/USING-VAULT.md
Consul + Vault + MySQL = <3
View USING-VAULT.md
git clone https://gist.github.com/dd6f95398c1bdc9f1038.git vault
cd vault
docker-compose up -d
export VAULT_ADDR=http://192.168.99.100:8200

Initializing a vault:

vault init
@joao-parana
joao-parana / install-docker-and-docker-compose-on-ubuntu.sh
Created Oct 21, 2016
Install docker and docker-compose Ubuntu Linux 16.04
View install-docker-and-docker-compose-on-ubuntu.sh
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@joao-parana
joao-parana / FutureDemo.scala
Created Mar 21, 2017
Testing non blocking futures
View FutureDemo.scala
package myscala.others
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import scala.util.{Failure, Random, Success}
object FutureDemo {
def sleep(duration: Long) {
Thread.sleep(duration)