Skip to content

Instantly share code, notes, and snippets.

View eskatos's full-sized avatar
⚒️
Crafting software

Paul Merlin eskatos

⚒️
Crafting software
View GitHub Profile
@eskatos
eskatos / webkit.py
Created May 20, 2011 15:36
simple pyqt4 webview
#!/usr/bin/env python
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
app = QApplication(sys.argv)
web = QWebView()
web.load(QUrl("http://google.fr"))
#!/usr/bin/perl
use CGI;
use File::Tail;
print "Content-type: text/html\n\n";
$| = 1; #set auto flush on
# hardcode filename
public class PrimeNumbersSeeker
{
private static final int ceiling = 100;
private static final int delay = 100;
public static void main( String[] args )
{
new PrimeNumbersSeeker().seek();
}
public class ThreadedPrimeNumbersSeeker
extends Thread
{
private static final int ceiling = 100;
private static final int interval = 1000;
private static final int delay = 100;
public int count = 0;
public int current = 2;
package qi4j;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Collector;
import java.util.stream.Stream;
import org.junit.Test;
@eskatos
eskatos / HelloWorld.java
Last active August 29, 2015 14:13
HelloQi4jWorld.java
@Mixins( { HelloWorld.Mixin.class } )
public interface HelloWorld
{
String say();
interface State
{
@NotEmpty Property<String> phrase();
@NotEmpty Property<String> name();
}
@eskatos
eskatos / netbeans-messages.log
Created February 16, 2015 13:02
netbeans-gradle-project #25
INFO [org.netbeans.gradle.project.ProjectLookupHack]: Using custom lookup for type org.netbeans.spi.java.classpath.ClassPathProvider
INFO [org.netbeans.gradle.project.ProjectLookupHack]: Using custom lookup for type org.netbeans.spi.java.classpath.ClassPathProvider
INFO [org.netbeans.gradle.project.ProjectLookupHack]: Using custom lookup for type org.netbeans.spi.java.classpath.ClassPathProvider
INFO [org.netbeans.gradle.project.ProjectLookupHack]: Using custom lookup for type org.netbeans.spi.java.classpath.ClassPathProvider
INFO [org.netbeans.gradle.project.ProjectLookupHack]: Using custom lookup for type org.netbeans.spi.java.classpath.ClassPathProvider
INFO [org.netbeans.gradle.project.ProjectLookupHack]: Using custom lookup for type org.netbeans.spi.java.classpath.ClassPathProvider
INFO [org.netbeans.gradle.project.ProjectLookupHack]: Using custom lookup for type org.netbeans.spi.java.classpath.ClassPathProvider
INFO [org.netbeans.gradle.project.ProjectLookupHack]: Using custom lookup for type org.netbea
@eskatos
eskatos / build.gradle
Created June 15, 2015 12:28
gradle gooffline
// Allow easy download of all dependencies to go offline
// ./gradlew gooffline
task gooffline {
doLast {
allprojects.configurations.flatten()*.resolvedConfiguration
}
}
@eskatos
eskatos / test.groovy
Last active December 3, 2015 14:29
Initialize @Unmanaged property on @Managed type
def "Initialize @Unmanaged property on @Managed type"() {
given:
buildFile << """
interface SomeThing {
void doSomething(String param)
}
class DefaultSomeThing implements SomeThing {
@Override
public void doSomething(String param) {
println param
@eskatos
eskatos / Elasticsearch 2.x local embedded.java
Created November 11, 2016 11:05
Elasticsearch 2.x local embedded
Settings settings = Settings.settingsBuilder().
put( "path.work", new File( new File( fileConfig.temporaryDirectory(), identity.toString() ), "work" ).getAbsolutePath() ).
put( "path.home", new File( new File( fileConfig.temporaryDirectory(), identity.toString() ), "home" ).getAbsolutePath() ).
put( "path.logs", new File( fileConfig.logDirectory(), identity.toString() ).getAbsolutePath() ).
put( "path.data", new File( fileConfig.dataDirectory(), identity.toString() ).getAbsolutePath() ).
put( "path.conf", new File( fileConfig.configurationDirectory(), identity.toString() ).getAbsolutePath() ).
put( "http.enabled", false ).
put( "index.cache.type", "weak" ).
put( "index.number_of_shards", 1 ).
put( "index.number_of_replicas", 0 ).