Skip to content

Instantly share code, notes, and snippets.

View jcarsique's full-sized avatar

Julien Carsique jcarsique

View GitHub Profile
@jdforsythe
jdforsythe / .gitconfig
Created March 13, 2019 15:37
Git rename stash alias
[alias]
rename-stash = "!_() { if [ -z \"$1\" ] || [ -z \"$2\" ]; then echo \"git rename-stash 0 NewName\" && echo \"\" && git stash list && exit 1; else stash=\"stash@{$1}\"; rev=$(git rev-parse \"${stash}\"); git stash drop \"${stash}\" || exit 1; git stash store -m \"$2\" \"$rev\" || exit 1; git stash list; fi }; _"
@docwhat
docwhat / Jenkinsfile
Last active December 16, 2023 13:53
Example pipeline usage of the Jenkins Mask Passwords plugin
// Requires https://plugins.jenkins.io/mask-passwords to run
/**
* Runs code with secret environment variables and hides the values.
*
* @param varAndPasswordList - A list of Maps with a 'var' and 'password' key. Example: `[[var: 'TOKEN', password: 'sekret']]`
* @param Closure - The code to run in
* @return {void}
*/
def withSecretEnv(List<Map> varAndPasswordList, Closure closure) {
@jonico
jonico / Jenkinsfile
Last active January 31, 2024 09:43
Example for a full blown Jenkins pipeline script with CodeQL analysis steps, multiple stages, Kubernetes templates, shared volumes, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, Docker containers, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, …
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
def label = "mypod-${UUID.randomUUID().toString()}"
podTemplate(label: label, yaml: """
spec:
containers:
- name: mvn
image: maven:3.3.9-jdk-8
@tiry
tiry / NuxeoVR.md
Last active December 28, 2016 15:20

What to show in VR ?

VR Assets browser --current choice--

Concept: Browse Nuxeo assets via Tag and 3D rendering

What it could look like: 3D VR Content View

  • preload repository with Images and 3D assets
#!/bin/bash
# remove exited containers:
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v
# remove unused images:
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi
# remove unused volumes:
find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <(
@bdelbosc
bdelbosc / ci-stat.gplot
Created August 26, 2014 09:12
Jenkins build stats using gnuplot
set terminal png transparent nocrop enhanced font arial 8 size 640,480
#set terminal png nocrop enhanced font arial 8 size 640,480
set output 'ci-stat.png'
set border 3 front linetype -1 linewidth 1.000
set boxwidth 0.75 absolute
set style fill solid 0.75 border -1
set grid nopolar
set grid noxtics nomxtics ytics nomytics noztics nomztics \
nox2tics nomx2tics noy2tics nomy2tics nocbtics nomcbtics
@jdennes
jdennes / Gemfile
Last active September 22, 2022 16:31
Export a list of members from a GitHub organisation
source "https://rubygems.org"
gem "octokit"
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.temporal.Temporal;
import java.util.ArrayList;
import java.util.Arrays;
@olamy
olamy / gist:3736092
Created September 17, 2012 07:56
Tip for Maven Builds faster
A tip for faster build (copy file really faster) with plexus-utils 3.0.7
<properties>
<plexusUtilsPluginsVersion>3.0.7</plexusUtilsPluginsVersion>
</properties>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<dependencies>