Skip to content

Instantly share code, notes, and snippets.

View guilhermesilveira's full-sized avatar

Guilherme Silveira guilhermesilveira

View GitHub Profile
#define TAMANHO_MAXIMO_DO_SEGREDO 4
#define REPETICOES_ESTADO_FINAL 3
#define TEMPO_LUZ 1000
#define TEMPO_PAUSA 500
#define ledVerde 2
#define ledAmarelo 3
#define ledVermelho 4
#define ledBranco 5
function soma(a,b) {
return a + b;
}
function maior(a,b) {
if(a > b) return a;
return b;
}
function somaPositivos(a) {
- double
- em horas
newInterval = 48
initialStepSmall = 1minute
initialStepBig = 10minutes
easyBonus = 1.3
class ClientCss {
public static String client_portfolio = "portfolio";
public static String client_card = "card";
public static String client_photo = "photo";
}
@guilhermesilveira
guilhermesilveira / ClientsController.java
Created October 21, 2014 19:29
Data Binding MVC example
package br.com.caelum.mvc;
public class ClientsController {
// reflection based conversion is NOT safe
public void save1(Client client) {
}
// primitives are safe
wget http://dl.bintray.com/caelum/VRaptor4/vraptor-blank-project--4.1.0-RC2.zip
unzip vraptor-blank-project--4.1.0-RC2.zip
cd vraptor-blank-project
mvn tomcat:run
Tomcat 6 escolhido:
> INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
curl -v http://localhost:8080
* Adding handle: conn: 0x7fdef4003000
public class MyWeld {
private static WeldContainer weldContainer = new Weld().initialize();
public static void main(String[] args) {
System.out.println(get(Router.class).allRoutes().size());
get(Router.class).allRoutes().stream().map(Route::getOriginalUri).forEach(System.out::println);
}
private static <T> T get(Class<T> type) {
Process: Plex Media Server [2724]
Path: /Applications/Plex Media Server.app/Contents/MacOS/Plex Media Server
Identifier: com.plexapp.plexmediaserver
Version: 0.9.8.18 (0.9.8.18.290-11b7fdd)
Code Type: X86-64 (Native)
Parent Process: launchd [175]
Responsible: Plex Media Server [2724]
User ID: 501
Date/Time: 2014-01-18 19:19:07.842 -0200
@guilhermesilveira
guilhermesilveira / halmoni.c
Created October 3, 2013 14:26
1. C언어 Stack and Dynamic allocation test when using fork 2. C언어 보무프로세스 죽는 test
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
int main()
{
pid_t pid, pid2;
if( (pid = fork()) < 0 ) {
perror("fork failed");
@guilhermesilveira
guilhermesilveira / Example.java
Last active December 24, 2015 04:49
custom serialization
public class Controller {
public void x() {
// custom whatever
result.from(object).with(new RafaelRuleOfNonArrayReplicationInJson());
// music include
result.from(object).with(include("musica"));