Skip to content

Instantly share code, notes, and snippets.

View rody's full-sized avatar

Rodolphe Blancho rody

  • Melbourne, Australia
View GitHub Profile
@rody
rody / findJar.groovy
Created November 4, 2011 13:34
findJar
import java.util.jar.*
/**
* Searches entries (file name and directory, if any) in one or more named
* compressed (jar/zip) files, or in all compressed files in a named directory.
* To specify a search that includes special characters, like a period, use
* a backslash: \.xml
*/
if( args.size() < 2){
println "Required parameters: searchString filePath [filePath]\n"
@rody
rody / GatlingExampleSimulation.scala
Created February 1, 2012 22:14
Example scenario for gatling
package com.exemple.test
import com.excilys.ebi.gatling.core.Predef._
import com.excilys.ebi.gatling.http.Predef._
import com.excilys.ebi.gatling.script.GatlingSimulation
class GatlingExampleSimulation extends GatlingSimulation {
val urlBase = "http://nancg1014:9080"
val httpConf = httpConfig.baseURL(urlBase)
@rody
rody / gist:2996363
Created June 26, 2012 15:13
Better log format in Git (Colorblind proof) and a nice bash prompt
Git log :
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
Bash prompt
export PS1'=\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[01;33m\]$(__git_ps1)\[\033[01;34m\] \$\[\033[00m\] '
@rody
rody / gist:3750294
Created September 19, 2012 15:32
bash script for a nice Git-aware prompt showing current branch and status
# Scavenged from Git 1.6.5.x contrib/completion/git_completion.bash
# __git_ps1 accepts 0 or 1 arguments (i.e., format string)
# returns text to add to bash PS1 prompt (includes branch name)
__gitdir ()
{
if [ -z "${1-}" ]; then
if [ -n "${__git_dir-}" ]; then
echo "$__git_dir"
elif [ -d .git ]; then
echo .git
@rody
rody / gist:786338f36e87124e9da3
Created November 24, 2015 11:38
Copy heroku config variables from one app to an other
heroku config -s -a ${APP1} | grep -v -e 'HEROKU' | sed 's/=\(.*\)/="\1"/' | xargs heroku config:set -a ${APP2}
@rody
rody / format-code-pull-request.yml
Created December 2, 2021 02:25
Github workflow to format files with Prettier on pull request
name: format-code-pull-request
on:
- pull_request
jobs:
format-source-code:
# Check if the PR is not from a fork
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
# only run if there are changed files