Skip to content

Instantly share code, notes, and snippets.

@thbkrkr
thbkrkr / gist:939872
Created April 24, 2011 20:57
guit vs gwt-platform
@EventBusHandler(RefreshHistorySyncListEvent.class)
public void $refreshHistorySyncList() {
doGetHistorySyncLastTen();
}
// @Override
// protected void onBind() {
// super.onBind();
// addRegisteredHandler(RefreshHistorySyncListEvent.getType(), new
// RefreshHistorySyncListHandler() {
@thbkrkr
thbkrkr / gist:953375
Created May 3, 2011 14:05
Client/Server serialization/deserialization for using Hibernate with GWT
// Server serialization
public class MServerSerializationStreamWriter extends AbstractSerializationStreamWriter
{
@Override
public void writeObject(Object object) throws SerializationException
{
if (object instanceof HibernateProxy)
{
HibernateProxy proxyId = (HibernateProxy)object;
@thbkrkr
thbkrkr / gist:962502
Created May 9, 2011 13:19
Component generated
// [GENERATED]
package pim.integ.mandarine.associationnaire;
import javax.annotation.Resource;
import javax.ejb.SessionContext;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import fr.mm.foundation.core.component.AbstractCrudHibernateEnterpriseBusinessComponent;
@thbkrkr
thbkrkr / .screenrc
Created November 10, 2011 07:09
.screenrc
# ------------------------------------------------------------------------------
# SCREEN KEYBINDINGS
# ------------------------------------------------------------------------------
startup_message off
deflogin on
autodetach on
# turn visual bell on
vbell on
@thbkrkr
thbkrkr / .conkyrc
Created November 10, 2011 07:10
.conkyrc
# set to yes if you want Conky to be forked in the background
background no
cpu_avg_samples 2
net_avg_samples 2
out_to_console no
# X font when Xft is disabled, you can pick one with program xfontsel
#font 7x12
@thbkrkr
thbkrkr / cpvod.groovy
Created November 10, 2011 07:13
Canal+ VOD Groovy
#!/usr/bin/groovy
/**
* \o/ Canal+ VOD 4 Linux \o/
*
* @date 06/11/2011
* @version 1.0
* @author thb
*/
import static Constants.*
@thbkrkr
thbkrkr / lbc.groovy
Created January 24, 2012 23:03
LeBonCoin to csv Groovy
#!/usr/bin/groovy
import org.htmlcleaner.*
import static C.*
class C {
static trucks = ['vito', 'transporter', '']
static cats = ['utilitaires', 'caravaning'/*, 'voitures'*/]
static kmMax = "200000"
@thbkrkr
thbkrkr / rsync.sh
Created January 24, 2012 23:15
rsync dir between two machines
#!/bin/bash
#
# rsync.sh /media/miam/photos bknt@192.168.0.1:/media/miam/sync_patate/photos
SRC=$1
DEST=$2
# rsync -e ssh -avz --delete-after
rsync -e ssh -avz $SRC $DEST
@thbkrkr
thbkrkr / check.groovy
Created February 23, 2012 17:11
fix config with wtp/jboss/maven/gwt
import static Constants.*
class Constants {
static final wsName = "mandarine"
static final serverPath= "c:\\\\xxxx\\\\yyyy\\\\server\\\\profil\\\\deploy";
static final wsPath = "c:\\\\xxxx\\\\ws\\\\$wsName\\\\.metadata\\\\.plugins\\\\org.eclipse.core.resources\\\\.projects"
}
// WS status
@thbkrkr
thbkrkr / foobarqix.groovy
Created February 24, 2012 22:17
devoxxfr codestory #1
#!/usr/bin/groovy
map = [ 3:"Foo", 5:"Bar", 7:"Qix" ]
for (i in 1..100) {
r = ""
map.each{ k, v -> r += isDiv(i, k, v) }
map.each{ k, v -> r += has(i, k, v) }
println i + " -> " + ((r == "") ? i : r)
}