Skip to content

Instantly share code, notes, and snippets.

@a-peyrard
a-peyrard / reflection.py
Created October 10, 2019 00:24
How to call a method dynamically from the current module
import sys
def foo_email(msg: str):
return "foo_email: " + msg
def foo_slack(msg: str):
return "foo_slack: " + msg
@a-peyrard
a-peyrard / recursive-git
Created February 1, 2017 20:27
Dummy script to apply a git command on every git repository found in the current path
#!/usr/bin/env bash
current_dir=$(pwd)
for p in $(find . -name ".git" -exec dirname {} \;)
do
cd $p
echo " -> $(pwd) -----------------------"
git $@
cd $current_dir
done

Keybase proof

I hereby claim:

  • I am a-peyrard on github.
  • I am apeyrard (https://keybase.io/apeyrard) on keybase.
  • I have a public key whose fingerprint is 0923 B5AD 511A F365 12F2 C0CF 3DF9 299F D72B BE42

To claim this, I am signing this object:

@a-peyrard
a-peyrard / MongoClientTest.java
Created April 19, 2015 18:01
test for restx's issue #193
package org.teutinc.teutssampleapp.mongo;
import static org.assertj.core.api.Assertions.assertThat;
import static restx.factory.Factory.LocalMachines.overrideComponents;
import org.junit.Rule;
import org.junit.Test;
import de.flapdoodle.embed.mongo.distribution.Version;
@a-peyrard
a-peyrard / IsAssignableFromBenchmark.java
Created February 22, 2015 14:49
isAssignableFrom benchmark
package io.restx.benchmarks;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import org.openjdk.jmh.annotations.Benchmark;
import java.io.Serializable;
import java.lang.reflect.Type;
import java.util.AbstractCollection;
import java.util.AbstractList;