Skip to content

Instantly share code, notes, and snippets.

View laminr's full-sized avatar

Thibault de Lambilly laminr

View GitHub Profile
@laminr
laminr / AndroidStudio as git difftool, mergetool
Created May 7, 2017 08:45 — forked from vgaidarji/AndroidStudio as git difftool, mergetool
Use AndroidStudio as git difftool/mergetool on MacOS (place this inside your ~/.gitconfig).
[merge]
tool = studio
[mergetool "studio"]
prompt = false
cmd = /Applications/Android\\ Studio.app/Contents/MacOS/studio merge $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED")
trustExitCode = true
[diff]
tool = studio
[difftool "studio"]
prompt = false
@laminr
laminr / Maven achetype create
Created April 21, 2017 19:04
Maven archetype:generate
// https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
mvn archetype:generate -DgroupId=biz.eventually.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
@laminr
laminr / Today
Created April 7, 2015 22:24
Getting today date formated dd/MM/yyyy
DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
String dateStr = dateFormat.format(new Date());
@laminr
laminr / latlong.js
Created January 29, 2015 21:56
Latitude/longitude spherical geodesy formulae & scripts
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* Latitude/longitude spherical geodesy formulae & scripts (c) Chris Veness 2002-2014 */
/* - www.movable-type.co.uk/scripts/latlong.html MIT Licence */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* jshint node:true *//* global define */
'use strict';
if (typeof module!='undefined' && module.exports) var Geo = require('./geo'); // CommonJS (Node.js)
@laminr
laminr / .gitignore
Last active August 29, 2015 14:11 — forked from octocat/.gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@laminr
laminr / ComputeHolidays
Created September 26, 2014 11:16
ComputeFrenchHolydays Java
/**
* Gestion des jours feries
*
* @param an
* @return
*/
private GregorianCalendar[] ComputeHolidays(int an) {
GregorianCalendar[] dates = new GregorianCalendar[11];
GregorianCalendar jourAn = new GregorianCalendar(an, 0, 1);
GregorianCalendar feteTravail = new GregorianCalendar(an, 4, 1);
@laminr
laminr / base.html.twig
Last active August 29, 2015 13:56
Symfony empty template
{% spaceless %}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="revisit-after" content="30 days" />
<meta name="robots" content="index,follow" />
<!--<meta name="author" content="" />-->
<meta name="copyright" content="" />
<meta name="distribution" content="global" />
@laminr
laminr / ResizeImage.php
Last active August 23, 2022 16:21
PHP Resize image with transparency
<?php
/*
* File: SimpleImage.php
* Author: Simon Jarvis
* Copyright: 2006 Simon Jarvis
* Date: 08/11/06
* Link: http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@laminr
laminr / htmlBoostrapTemplate
Created December 5, 2013 08:45
Htlm boostrap template
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap 101 Template</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
@laminr
laminr / console-doctrine-importDB.txt
Created November 24, 2013 10:48
console-doctrine-importDB.txt
php app/console doctrine:mapping:convert yml ./src/cjrp/WebsiteBundle/Resources/config/doctrine/metadata/orm --from-database --force
php app/console doctrine:mapping:import cjrpWebsiteBundle annotation
php app/console doctrine:generate:entities cjrpWebsiteBundle