Skip to content

Instantly share code, notes, and snippets.

View tmarwen's full-sized avatar
🇵🇸

Marouane Trabelsi tmarwen

🇵🇸
View GitHub Profile
@tmarwen
tmarwen / settings.xml
Created January 28, 2015 08:57
Complete Maven settings file with all elements with documented usage
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
#---------------------------------------------------------------------
#
# Parse the response from Sonatype Nexus in order to determine the
# correct URI for the most recent snapshot of an artifact.
#
# Usage:
# ruby get_latest_snapshot.rb \
# -n http://localhost:8080/nexus \
# -g uk.co.scattercode \
# -a my-artifact \
import com.github.jknack.handlebars.Helper;
import com.github.jknack.handlebars.Options;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import java.io.IOException;
import java.io.InputStream;
//Method Only
@SuppressWarnings("rawtypes")
@RequestMapping(value = "/cityGridView", method = RequestMethod.GET)
public @ResponseBody
Object[] showLineChart(Map<String, Object> map, HttpServletRequest request,
HttpServletResponse response) {
List<MapTable> list = contactService.fin();
Object[] rows = new Object[list.size()];
int i = 0;
@tmarwen
tmarwen / Git awesome aliases.md
Last active August 29, 2015 14:06
Git awesome, useful aliases...

Some useful aliases include:

Alias Command What to Type
git cm git commit git config --global alias.cm commit
git co git checkout git config --global alias.co checkout
git ac git add . -A git commit git config --global alias.ac 'add -A && git commit'
git st git status -sb git config --global alias.st 'status -sb'
git tags git tag -l git config --global alias.tags 'tag -l'
git branches git branch -a git config --global alias.branches 'branch -a'
@tmarwen
tmarwen / A curated list of awesome lists.md
Last active August 29, 2015 14:06
A cureated List of awesome Lists... Forked from https://github.com/sindresorhus/awesome and thought it would be "awesome" as a Gist
@tmarwen
tmarwen / git-clean-line-endings
Last active August 29, 2015 14:05
Fix line endings after repo initialization
#Thanks to Charles Bailey for his answer in this SO post: http://stackoverflow.com/a/1511273/2106516
# From the root of your repository remove everything from the index
git rm --cached -r .
# Change the autocrlf setting of the repository (you may want
# to use true on windows):
git config core.autocrlf input
# Re-add all the deleted files to the index
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@tmarwen
tmarwen / jboss-init.sh
Last active August 29, 2015 14:04
Straightforward script to init jboss AS as *nix service
#!/bin/sh
# Use --debug to activate debug mode with an optional argument to specify the port.
# Usage : standalone.bat --debug
# standalone.bat --debug 9797
# By default debug mode is disable.
#!/bin/bash### BEGIN INIT INFO
#! /bin/sh
# ==================================================================
# ______ __ _____
# /_ __/___ ____ ___ _________ _/ /_ /__ /
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / /
# / / / /_/ / / / / / / /__/ /_/ / /_ / /
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/ /_/
# Multi-instance Apache Tomcat installation with a focus
# on best-practices as defined by Apache, SpringSource, and MuleSoft