Skip to content

Instantly share code, notes, and snippets.

@mcastets
mcastets / k8s-async-profiler.sh
Created June 15, 2023 12:29
Execution d'un async profiler sur un pod k8s pour récupérer un flame graph
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
if [ "$#" -lt 1 ]; then
echo "Missing pod_name argument"
echo "usage : $0 <pod_name> <async_profiler_event>"
else
pod_name=$1
# Basic events: wall, alloc, cpu, itimer lock. See https://krzysztofslusarski.github.io/2022/12/12/async-manual.html
@mcastets
mcastets / .zshrc
Created May 4, 2023 18:56 — forked from callumlocke/.zshrc
ZSH function to auto-switch to correct Node version
####
# ZSH function to auto-switch to correct Node version
# https://gist.github.com/callumlocke/30990e247e52ab6ac1aa98e5f0e5bbf5
#
# - Searches up your directory tree for the closest .nvmrc, just like `nvm use` does.
#
# - If you are already on the right Node version, IT DOES NOTHING, AND PRINTS NOTHING.
#
# - Works correctly if your .nvmrc file contains something relaxed/generic,
# like "4" or "v12.0" or "stable".
@mcastets
mcastets / gist:3591de8e86ffe1b0a87a45d7aeeb4e9e
Created June 12, 2019 11:27 — forked from stuart11n/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@mcastets
mcastets / nationality_en.properties
Last active January 13, 2016 10:56
Clé : Code pays ISO 3166 - Valeur : Gentilé en français
nationality.AD.H=Andorran
nationality.AD=Andorran
nationality.AE.H=Emirian
nationality.AE=Emirian
nationality.AF.H=Afghani
nationality.AF=Afghani
nationality.AG.H=Antiguan
nationality.AG=Antiguan
nationality.AI.H=Anguillan
nationality.AI=Anguillan
@mcastets
mcastets / country_en.properties
Last active January 13, 2016 10:57
Property file where key is country code (ISO 3166 compliant) and value is country name
country.=
country.AD=Andorra
country.AE=United Arab Emirates
country.AF=Afghanistan
country.AG=Antigua And Barbuda
country.AI=Anguilla
country.AL=Albania
country.AN=Curacao
country.AO=Angola
country.AR=Argentina
package com.someco.cmis.examples;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.math.BigInteger;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.chemistry.opencmis.client.api.Document;