Skip to content

Instantly share code, notes, and snippets.

View aneveux's full-sized avatar
🐝
ʕノ•ᴥ•ʔノ ︵ ┻━┻

Antoine Neveux aneveux

🐝
ʕノ•ᴥ•ʔノ ︵ ┻━┻
View GitHub Profile
@aneveux
aneveux / jachievement_example_1.java
Created May 7, 2012 09:42
Simple notifications using JAchievement
Achievement achievement = new Achievement("Achievement unlocked", "My first Java code.");
AchievementQueue queue = new AchievementQueue();
queue.add(achievement);
@aneveux
aneveux / SoundPlayer.java
Created May 9, 2012 08:19
This class allows to play a *.wav sound in a particular thread
import java.io.IOException;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.LineEvent;
import javax.sound.sampled.LineEvent.Type;
import javax.sound.sampled.LineListener;
import javax.sound.sampled.LineUnavailableException;
@aneveux
aneveux / LCEB.java
Created April 2, 2013 12:53
Simple Java code written during a Live Coding session (~30min.) solving the "Compte est bon" game, which aims at finding all the operations to apply to a list of numbers to get an expected result. Warning: this source code is not optimized, and could be better, but the goal was to write it quickly in some kind of competition ;)
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class LCEB {
public List<String> resolve(final List<Integer> numbers,
final Integer expected) {
return getSolutions(expected, numbers, null, null);
}
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="com.worldline.clic.commands">
<command
description="Just an example of a command you could develop..."
id="example:hello"
implementation="com.acme.sample.commands.HelloCommand">
</command>
package com.acme.sample.commands;
import com.acme.sample.Messages;
import com.worldline.clic.commands.AbstractCommand;
import com.worldline.clic.commands.CommandContext;
/**
* Just an example of a command...
*
* @author aneveux
@aneveux
aneveux / plugin.xml
Last active December 27, 2015 18:59
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="com.worldline.clic.commands">
<command
description="Just an example of a command you could develop..."
id="example:hello"
implementation="com.sample.demo.commands.HelloCommand">
</command>
package com.sample.demo.commands;
import com.sample.demo.Messages;
import com.worldline.clic.commands.AbstractCommand;
import com.worldline.clic.commands.CommandContext;
/**
* Just an example of a command...
*
* @author aneveux
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.worldline.clic</groupId>
<artifactId>example.remote-shell</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Remote Shell Example</name>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.worldline.clic</groupId>
<artifactId>example.remote-shell</artifactId>
<version>[1.0.0-SNAPSHOT,)</version>
</parent>
clic:mvn --maven-reference com.worldline.clic:example.remote-shell:1.0.0-SNAPSHOT --generate-pom --maven-command antrun:run -Dhost=my-host -Dport=22 -Dkeyfile=/path/to/id_rsa -Dpassphrase=mySecretPassphrase -Dusername=myself -Dcommand='uname -a'