Skip to content

Instantly share code, notes, and snippets.

View mcgivrer's full-sized avatar

Frédéric Delorme mcgivrer

View GitHub Profile
@mcgivrer
mcgivrer / AbstractGamePanel.java
Last active January 12, 2018 00:49
A VERY Basic framework to ignite a game, with the very standard structure : initialize(), loop(), input(), update(float) and render(Graphics2D). Also provide a simple input handler to manage key events
package com.snapgames.tutorials.t001.flavour2;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import javax.swing.JPanel;
import com.snapgames.tutorials.core.io.InputHandler;
@mcgivrer
mcgivrer / pom.xml
Created March 31, 2017 21:03
Maven Standard Java project
<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>[group_id]</groupId>
<artifactId>[artifact_id]</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>[project_name]</name>
<description>[project_description]</description>
@mcgivrer
mcgivrer / .gitignore
Last active April 16, 2025 22:04
Standard Java desktop maven project with a pom.xml file, a README.md, and some Continuous integration configuration files (AppVeyor and Travis-CI, more to come...)
target/
.project
.classpath
.settings/
@mcgivrer
mcgivrer / GenericRepository.java
Last active June 7, 2016 12:34
JPA Light Generic repository from scratch
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
{
"working_dir": "$file_path",
"shell_cmd":"mvn clean install",
"variants": [
{
"name": "mvn clean install",
"shell_cmd": "mvn clean install"
},
{
"name": "mvn full build",
@mcgivrer
mcgivrer / pom.xml
Last active December 16, 2015 06:58
Maven pom.xml file with multi-plateforme dependencies
<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>fr.mcgivrer.samples</groupId>
<artifactId>swt-project</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>swt-project</name>
<description>Dicovering SWT API/description>
<build>
@mcgivrer
mcgivrer / GenericDaoTest.java
Last active December 13, 2015 23:28
Here is a small piece of code to parse package and detect @entity annotated classes. Starting from a persistence.xml file wich describe a "application" persistence unit, Annotated classes would be added to the EntityManager created, based on persistence.xml configuration. No more need to add <class /> tags to the persistence file. thanks to Refl…
package fr.mcgivrer.applications.angulargames.test.dao;
import java.util.Map;
import java.util.Properties;
import javax.persistence.Entity;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
@mcgivrer
mcgivrer / cibox.sh
Created November 9, 2012 00:40
A small script to start/stop all services for a Continuous Integration Server.
#!/bin/bash
# Small script to start/stop a
# Continuous Integration server based on ubuntu 12.04.
# inspired by sonar service script.
# (copyleft) 2012 - McGivrer
#
checkUser() {
# $1 touchLock flag
# $2 command
@mcgivrer
mcgivrer / Dao.java
Created June 6, 2012 13:18
A DAO and its Generic implementation inspired/guided by an Augusto GIST and simplified/adapted (see reference in the first file)to our needs.
package fr.mcgivrer.framework.web.persist;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
public interface Dao <T, PK extends Serializable> {
/**
* save an entity. This can be either a INSERT or UPDATE in the database.
*
@mcgivrer
mcgivrer / dabblet.css
Created February 28, 2012 17:21
Untitled
p{
margin:0px;
padding:0px;
}
article.post {
font-family: Tahoma, Verdana, Sans Serif;
font-size: 10pt;
width:90%;
margin:0% 5%;
}