Skip to content

Instantly share code, notes, and snippets.

View vietj's full-sized avatar
🤖
Coding the Future

Julien Viet vietj

🤖
Coding the Future
View GitHub Profile
@dgageot
dgageot / CodeStoryStatusTest.java
Last active November 4, 2021 10:20
FluentLenium, PhantomJs, GhostDriver
package net.gageot;
import org.junit.Test;
import static org.fest.assertions.Assertions.assertThat;
public class CodeStoryStatusTest extends PhantomJsTest {
@Override
public String defaultUrl() {
return "http://status.code-story.net";
# Building JBoss AS 7.2.0.Final
wget https://github.com/jbossas/jboss-as/archive/7.2.0.Final.tar.gz
tar -xvf 7.2.0.Final.tar.gz
cd jboss-as-7.2.0.Final
./build.sh -DskipTests -Drelease=true # -Drelease=true creates the distribution archives
# Copy the binaries
cp -R build/target/jboss-as-7.2.0.Final /opt/java/
# Copy the archive
cp dist/target/jboss-as-7.2.0.Final.zip ~/archives/
@hgomez
hgomez / install-crash-1.2.0-cr7.md
Created March 14, 2013 14:49
Install crash 1.2.0-cr7 via devops-incubator rpm

Download and install crash via rpm

rpm -Uvh http://dl.bintray.com/content/hgomez/devops-incubator-rpm/crash-1.2.0.cr7-1.noarch.rpm

Start crash

crash.sh

   ______
 .~      ~. |`````````,       .'.                   ..'''' |         |
anonymous
anonymous / dir.groovy
Created February 21, 2014 14:02
A set of shell JVM commands for CRaSH http://try.crashub.org
// Class based commands using annotations
class dir {
@Usage("show the current directory")
@Command
void main(@Usage("the dir to list") @Argument String path) {
File dir = path != null ? new File(path) : new File(".");
def files = dir.listFiles();
files.each { file ->
context.provide(NAME:file.name,LENGTH:file.length(),DATE:new Date(file.lastModified()))
}
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7')
import groovyx.net.http.RESTClient
import static groovyx.net.http.ContentType.*
import org.crsh.text.ui.UIBuilder
UIBuilder ui = new UIBuilder();
def http = new RESTClient( 'http://localhost:8080/pentaho/' )
def resp = http.get( path: 'content/ws-run/soapConnectionService/getConnections', query: [userid: 'admin', password: 'password'] )
@dgageot
dgageot / FindParametersTypes.java
Created August 19, 2014 10:03
Find Lambda parameter types
package test;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Arrays;
import java.util.function.Function;
import static java.util.stream.Stream.of;
public class FindParametersTypes {
@dgageot
dgageot / FindParametersTypes.java
Created August 19, 2014 10:05
Find Lambda parameter types with serialization. Works only on serializable lambda
package avaj.lang.invoke;
import java.io.*;
import java.lang.invoke.SerializedLambda;
import static java.nio.charset.StandardCharsets.ISO_8859_1;
public class FindParametersTypes {
public static void main(String[] args) throws Exception {
System.out.println(getMethodSignature((String s) -> s));
@aesteve
aesteve / build.gradle
Created April 3, 2015 16:41
vertx-metrics-demo Gradle
plugins {
id 'java'
id 'eclipse'
id 'idea'
id 'com.github.johnrengelman.shadow' version '1.2.1'
}
repositories {
mavenLocal()
mavenCentral()
@doanduyhai
doanduyhai / Type Annotations on VariableElement
Last active August 29, 2015 14:21
Type Annotations on VariableElement
public static class SimpleEntityCodecFactoryTest {
private Map<@JSON Integer,Map<@Frozen Integer,@Enumerated(value = Enumerated.Encoding.NAME, test = "123") String>> map;
}
final TypeElement typeElement = elementUtils.getTypeElement(SimpleEntityCodecFactoryTest.class.getCanonicalName());
final List<VariableElement> els = ElementFilter.fieldsIn(typeElement.getEnclosedElements());
final VariableElement mapElt = els.stream().filter(x -> x.getSimpleName().contentEquals("map")).findFirst().get();
final com.sun.tools.javac.util.List<Attribute.TypeCompound> typeAttributes = ((Symbol.VarSymbol) mapElt).getMetadata().getTypeAttributes();
@vietj
vietj / codegen-howto.adoc
Last active August 29, 2015 14:23
Codegen howto

Codegen

An howto for codegen.

Preliminary

Codegen is able to handle model generation for different kind of models:

  • module

  • package