Skip to content

Instantly share code, notes, and snippets.

View fcamblor's full-sized avatar

Frédéric Camblor fcamblor

View GitHub Profile
@fcamblor
fcamblor / README
Last active December 14, 2015 16:38
This bash script will allow you to make a "tardive amend" of a commit in your git history
Use case :
o <- HEAD
|
....
|
o <- (2) Here, you fixed something wrong in (1)
|
....
|
@fcamblor
fcamblor / late-amend.sh
Last active December 14, 2015 16:38
This bash script will allow you to make a "late amend" of a commit (not the latest) in your git history
#!/bin/bash
targetSha1=$1
currentSha1=`git rev-parse HEAD`
previousSha1=`git rev-parse HEAD^`
currentBranchName=`git rev-parse --abbrev-ref HEAD`
sha1ToApply=
if [ "" == "$1" ]
then
@fcamblor
fcamblor / gist:5508146
Created May 3, 2013 09:18
Tomcat6's logging.properties
handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, 3manager.org.apache.juli.FileHandler, 4host-manager.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
.handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################
1catalina.org.apache.juli.FileHandler.level = FINE
// CONFIGURES RIVETS.JS WITH BACKBONE.JS
// Collection support implemented, thanks to https://github.com/mikeric/rivets/issues/57#issuecomment-13364792
rivets.configure({
adapter: {
subscribe: function(obj, keypath, callback) {
if (obj instanceof Backbone.Collection) {
obj.on('add remove reset', function () {
callback(obj[keypath])
});
} else {
npm ERR! error rolling back Error: Refusing to delete: /usr/local/share/npm/bin/bower not in /usr/local/share/npm/lib/node_modules/bower-canary
npm ERR! error rolling back at clobberFail (/usr/local/Cellar/node/0.8.11/lib/node_modules/npm/lib/utils/gently-rm.js:41:12)
npm ERR! error rolling back at next (/usr/local/Cellar/node/0.8.11/lib/node_modules/npm/lib/utils/gently-rm.js:27:14)
npm ERR! error rolling back at /usr/local/Cellar/node/0.8.11/lib/node_modules/npm/lib/utils/gently-rm.js:36:12
npm ERR! error rolling back at Object.oncomplete (fs.js:297:15)
npm ERR! error rolling back [email protected] { [Error: Refusing to delete: /usr/local/share/npm/bin/bower not in /usr/local/share/npm/lib/node_modules/bower-canary] code: 'EEXIST', path: '/usr/local/share/npm/bin/bower' }
npm ERR! Refusing to delete: /usr/local/share/npm/bin/bower not in /usr/local/share/npm/lib/node_modules/bower-canary
File exists: /usr/local/share/npm/bin/bower
Move it away, and try again.
@fcamblor
fcamblor / gist:5966126
Last active November 22, 2021 11:07
pom.xml file skeleton
<?xml version="1.0" encoding="UTF-8"?>
<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>MYGROUP</groupId>
<artifactId>MYARTIFACT</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
@fcamblor
fcamblor / README.md
Last active December 22, 2015 07:29
Import remote myqsl db script, transfering sql script with ge.tt service

Pre-requisites

Will need some unusual packages : jsawk

Sample Usage

importRemoteDb.sh my-user@my-server my-remote-db-user my-remote-db-password my-remote-db-name my-local-db-name

Notes

@fcamblor
fcamblor / tryrestx.sh
Last active August 29, 2015 13:56
Try restx
# Prerequisites :
# - Java7 installed
# - Internet connexion
curl -s http://restx.io/install.sh | sh; cd /tmp; restx app new
# Then open your browser to http://localhost:8080/api/@/ui/
# Particularly on http://localhost:8080/api/@/ui/api-docs/
# To see an existing running app, you can execute this too :
@fcamblor
fcamblor / Step 1
Last active August 29, 2015 13:57
Some git story
PR from myBranch -> 2
|
1 c
\|
b <- here is fc
|
a