Skip to content

Instantly share code, notes, and snippets.

View msimonin's full-sized avatar
💭
moving to gitlab

Matthieu Simonin msimonin

💭
moving to gitlab
View GitHub Profile
@msimonin
msimonin / assembly.xml
Last active August 29, 2015 14:03
example of maven assembly plugin (issue with sshj and shaded jars)
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>mon-dir-final</id>
<formats>
<format>dir</format>
</formats>
<fileSets>
<fileSet>
<directory>target</directory>
@msimonin
msimonin / villes france
Created June 7, 2014 08:21
villes de france
This file has been truncated, but you can view the full file.
id,departement,nom_reel,code_postal,commune,population_1999,population_2010,surface,longitude_degre,latitude_degre,ville_zmin,ville_zmax,population_2010_order_france,densite_2010_order_france,surface_order_france
1,01,Ozan,01190,284,618,469,660,4.91667,46.3833,170,205,14126,8823,26916
2,01,Cormoranche-sur-Saône,01290,123,1058,903,985,4.83333,46.2333,168,211,9070,7767,19911
3,01,Plagne,01130,298,129,83,620,5.73333,46.1833,560,922,31104,25594,27923
4,01,Tossiat,01250,422,1406,1111,1017,5.31667,46.1333,244,501,6981,6080,19270
5,01,Pouillat,01250,309,88,58,623,5.43333,46.3333,333,770,33678,30030,27847
6,01,Torcieu,01230,421,698,643,1072,5.4,45.9167,257,782,12850,12294,18284
7,01,Replonges,01620,320,3500,2841,1660,4.88333,46.3,169,207,2854,3952,10566
8,01,Corcelles,01110,119,243,222,1416,5.58333,46.0333,780,1081,24829,28023,13201
9,01,Péron,01630,288,2143,1578,2601,5.93333,46.2,411,1501,4673,9985,4869
@msimonin
msimonin / Vagrantfile
Last active August 29, 2015 14:01
Snooze dev
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "dev" do |dev|
dev.vm.box = "hashicorp/precise64"
# start time stop time -> starttime stoptime
sed -r 's/([^ 0-9]) ([^ 0-9])/\1\2/g'
# starttime stoptime -> starttime stoptime
sed 's/ */\ /g'
# By default taken from .ssh/config
# globally not related to the backend :
SSHKit.config.backend.config.ssh_options = {:user => "msimonin"}
# globally related to netssh
SSHKit::Backend::Netssh.config.ssh_options = { :user => "msimonin"}
# globally block
SSHKit.config.backend.configure do |ssh|
@msimonin
msimonin / jenkins-and-pull request
Last active December 24, 2015 21:39
Jenkins pull request receiver
#!/usr/bin/env ruby
# when jenkins received the post payload from github
# clone the repository, and try to merge the pull request before build.
# jenkins must be configured as parametrized one with "payload" parameter.
require 'rubygems'
require 'json'
@msimonin
msimonin / git rebase -i
Created September 19, 2013 08:11
squash commit
http://stackoverflow.com/questions/7947322/preferred-github-workflow-for-updating-a-pull-request-after-code-review
@msimonin
msimonin / lockObject
Last active December 22, 2015 07:38
lock object suspend thread for a while.
private Object lockObject_;
/** Run method. */
public void run()
{
try
{
while (!isTerminated_)
{
// do something here
@msimonin
msimonin / loadPlugins
Last active May 7, 2023 12:55
[java] plugin management by reflection
// replace schedulerSettings ...
try{
String pluginsDirectory = schedulerSettings.getPluginsDirectory();
Class placementClass = PluginsUtils.getClassFromDirectory(pluginsDirectory , placementPolicy);
log_.debug(String.format("instantiate the placement policy %s from the jar",placementPolicy));
Object placementObject = placementClass.getConstructor(ResourceDemandEstimator.class).newInstance(estimator);
placement = (PlacementPolicy)placementObject;
}
catch (Exception e)
{