Skip to content

Instantly share code, notes, and snippets.

View JulienBreux's full-sized avatar

Julien Breux JulienBreux

View GitHub Profile
@JulienBreux
JulienBreux / circle-tag.sh
Created December 12, 2019 16:00
CircleCI Tag
TAG=$(echo ${CIRCLE_SHA1} | cut -c1-7)
if [ ! -z "${CIRCLE_TAG}" ]; then
TAG="${CIRCLE_TAG}"
fi
@JulienBreux
JulienBreux / Dockerfile
Created August 19, 2019 15:37
Speed Nginx Docker (for tests)
FROM nginx:1-alpine
COPY ./src/index.html /usr/share/nginx/html
COPY ./etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
@JulienBreux
JulienBreux / index-mgd.go
Created April 16, 2019 11:22
mgo vs mongo-go-driver
import (
"go.mongodb.org/mongo-driver/mongo"
mongooptions "go.mongodb.org/mongo-driver/mongo/options"
)
// createSlugIndex creates the slug index in Mongo collection
func createSlugIndex(ctx context.Context, c mongo.Collection) (err error) {
ptrTrue := true
ptrSlug := "slug"
_, err = c.Indexes().CreateMany(ctx, []mongo.IndexModel{
@JulienBreux
JulienBreux / .dotenv.sh
Last active September 26, 2018 08:14
source ~/.dotenv.sh
cd()
{
debug()
{
if [ $DOTENVSH_DEBUG = true ]; then
echo $1
fi
}
loadenv()

Keybase proof

I hereby claim:

  • I am JulienBreux on github.
  • I am julienbreux (https://keybase.io/julienbreux) on keybase.
  • I have a public key whose fingerprint is 28FD 65AB 03BB 4A67 331E FBDE C71D 9FA1 0BD0 23FA

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am julienbreux on github.
  • I am julienbreux (https://keybase.io/julienbreux) on keybase.
  • I have a public key ASDX3SYzzRVnHSFo7v1PiM8YwElxqPLbTOlj0feEKRLmUgo

To claim this, I am signing this object:

@JulienBreux
JulienBreux / index.php
Last active December 26, 2015 08:08
Twilio Test
<?php
// Lib: https://github.com/twilio/twilio-php
require_once __DIR__.'/libs/twilio/Services/Twilio.php';
// Constants
const SID = 'AC...';
const TKN = '...';
const NBR = '+33XXXXXXXXX';
// Variables
@JulienBreux
JulienBreux / crop.php
Created June 19, 2013 12:56
Croping for OpenLayers|OpenStreetMap
#!/usr/bin/php
<?php
$widthTile = 256;
$heightTile = 256;
if (!isset($argv[1]))
{
exit('No input file argument'.PHP_EOL);
}
@JulienBreux
JulienBreux / st2.json
Last active December 18, 2015 16:39
ST2 - Preferences
// Packager: http://wbond.net/sublime_packages/package_control
// Packages: SublimeLinter, Emmet, Git
{
"font_size": 13.0,
"ignored_packages":
[
"Vintage"
],
"highlight_line": true,
"highlight_modified_tabs": true,
@JulienBreux
JulienBreux / gist:5480728
Last active December 16, 2015 18:49
This little script will protect access to dirs. Use like this: /home/<user>/www/fichiers/admin/index.php /home/<user>/www/fichiers/<first-directory>/ /home/<user>/www/fichiers/<second-directory>/
<?php
/////// FUNCTIONS
function removeHtaccess($path, $filename = '.htaccess')
{
file_exists($path.DIRECTORY_SEPARATOR.$filename) && unlink($path.DIRECTORY_SEPARATOR.$filename);
}
function removeHtpasswd($path, $filename = '.htpasswd')
{
file_exists($path.DIRECTORY_SEPARATOR.$filename) && unlink($path.DIRECTORY_SEPARATOR.$filename);