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 / 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));
@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 {
@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'] )
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()))
}
@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

   ______
 .~      ~. |`````````,       .'.                   ..'''' |         |
# 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/
@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";