Skip to content

Instantly share code, notes, and snippets.

View fcamblor's full-sized avatar

Frédéric Camblor fcamblor

View GitHub Profile
@fcamblor
fcamblor / tryrestx.sh
Last active August 29, 2015 13:56
Try restx
View tryrestx.sh
# Prerequisites :
# - Java7 installed
# - Internet connexion
curl -s http://restx.io/install.sh | sh; cd /tmp; restx app new
# Then open your browser to http://localhost:8080/api/@/ui/
# Particularly on http://localhost:8080/api/@/ui/api-docs/
# To see an existing running app, you can execute this too :
@fcamblor
fcamblor / Step 1
Last active August 29, 2015 13:57
Some git story
View Step 1
PR from myBranch -> 2
|
1 c
\|
b <- here is fc
|
a
View error.log
2014-04-07 08:35:20,124 [main ] [ ] INFO restx.monitor.MetricsConfiguration - registering Metrics JVM metrics
2014-04-07 08:35:53,210 [qtp21621940-22 ] [ ] WARN o.e.jetty.servlet.ServletHandler - Error for /api/@/ui/
java.lang.NoSuchMethodError: restx.factory.Factory.prepare()Lrestx/factory/Factory;
at restx.RestxMainRouterFactory$PerRequestFactoryLoader.route(RestxMainRouterFactory.java:208) ~[restx-core-0.32-SNAPSHOT.jar:na]
at restx.RestxMainRouterFactory$RecordingMainRouter.route(RestxMainRouterFactory.java:174) ~[restx-core-0.32-SNAPSHOT.jar:na]
at restx.RestxMainRouterFactory$CompilationManagerRouter.route(RestxMainRouterFactory.java:326) ~[restx-core-0.32-SNAPSHOT.jar:na]
at restx.servlet.AbstractRestxMainRouterServlet.service(AbstractRestxMainRouterServlet.java:48) ~[restx-servlet-0.32-SNAPSHOT.jar:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) ~[javax.servlet-3.0.0.v201112011016.jar:na]
at org.eclipse.jetty.servlet.ServletHolder.handle(Servle
@fcamblor
fcamblor / gist:10104501
Created April 8, 2014 09:34
qzui release:perform fail due to hardcoded dependency path between srv & ui
View gist:10104501
fcamblor@lacoste ~/Documents/projects/qzui/srv
$> mvn release:prepare release:perform
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for quartz-ui:quartz-ui:war:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-war-plugin is missing. @ line 122, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
View 0 - Merging "direct" .. ce que je préfère éviter
o <- myFeature origin/myFeature # Commit 2 de ma feature
o | <- master origin/master # Commit 2 de mon collègue sur master
| o # Commit 1 de ma feature
o | # Commit 1 de mon collègue sur master
| /
o # Point d'embranchement de ma feature
|
o
(-) $> git checkout master
@fcamblor
fcamblor / gist:41e6701e94c81ea855c1
Last active August 29, 2015 14:01
Share folder between osx and boot2docker
View gist:41e6701e94c81ea855c1

Pour que le tout fonctionne sous mac OS X (via boot2docker) :

  • Rajouter nameserver 8.8.8.8 dans votre fichier /etc/resolv.conf de votre vm docker (après un boot2docker ssh)

  • Penser à avoir effectué un port forwarding entre votre OS X et la machine boot2docker :

    for i in {49000..49900}; do
      VBoxManage modifyvm "boot2docker-vm" --natpf1 "tcp-port$i,tcp,,$i,,$i";
      VBoxManage modifyvm "boot2docker-vm" --natpf1 "udp-port$i,udp,,$i,,$i";
    done
    
@fcamblor
fcamblor / Foo.java
Last active August 29, 2015 14:01
Generics WTF
View Foo.java
import java.util.concurrent.Callable;
public class Foo {
public static void main(String[] args){
final Bar bar = new Bar();
bar.cast("blah", String.class); // ok
new Callable<String>(){
@Override
public String call() throws Exception {
@fcamblor
fcamblor / MyObject.scala
Last active August 29, 2015 14:02
Implicits in scala templates
View MyObject.scala
case class MyObject ( var content: () => HtmlFormat.Appendable )
// This trait will be applied on my Play2 controllers
trait MyObjectImplicit {
implicit def myInstance: MyObject = MyObject(() => innerTemplate())
}
@fcamblor
fcamblor / S3StorageConfigResource
Created November 26, 2014 20:44
Upload files on s3 using restx
View S3StorageConfigResource
package fpm.rest;
import com.mongodb.util.Base64Codec;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.format.ISODateTimeFormat;
import restx.annotations.GET;
import restx.annotations.RestxResource;
import restx.common.RestxConfig;
import restx.config.ConfigSupplier;