Skip to content

Instantly share code, notes, and snippets.

@jlgeering
jlgeering / gitlab-registry-stats.py
Last active March 24, 2017 08:46 — forked from pbabics/gitlab-registry-stats.py
Prints statistics per project in gitlab registry (usefull for debugging purposes)
#!/usr/bin/env python2.7
import os
import json
import argparse
import math
def convert_size(size_bytes):
if (size_bytes == 0):
return '0B'

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@jlgeering
jlgeering / gist:8858f6f0ed0f398d6e94
Created January 4, 2015 17:35
Openname verification
Verifying that +jeanlucgeering is my openname (Bitcoin username). https://onename.io/jeanlucgeering
@jlgeering
jlgeering / Dockerfile
Last active January 1, 2016 05:29
Dockerfile for ES with plugins
FROM stackbrew/ubuntu
MAINTAINER Jean-Luc Geering <jeanluc.geering@ufirstgroup.com>
RUN apt-get update
RUN apt-get install -q -y git-core
RUN apt-get install -q -y curl
# Install Java 7
RUN DEBIAN_FRONTEND=noninteractive apt-get install -q -y software-properties-common
@jlgeering
jlgeering / sublime-keymap
Created February 29, 2012 11:00
Sublime Text 2 - Key Bindings
[
{ "keys": ["super+up"], "command": "swap_line_up" },
{ "keys": ["super+down"], "command": "swap_line_down" },
{ "keys": ["super+alt+down"], "command": "duplicate_line" },
{ "keys": ["alt+super+s"], "command": "prompt_save_as" },
{ "keys": ["shift+super+s"], "command": "save_all" },
{ "keys": ["ctrl+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} },
{ "keys": ["super+d"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} },
{ "keys": ["super+7"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["super+shift+7"], "command": "toggle_comment", "args": { "block": true } }
@jlgeering
jlgeering / parse_csv.groovy
Created February 16, 2012 18:25
Groovy CSV to SQL
#!/usr/bin/env groovy
import groovy.sql.Sql
// Because of the way JDBC drivers are loaded, configure Grape to attach JDBC driver
// dependencies to the system class loader
// see http://groovy.codehaus.org/Grape
@GrabConfig(systemClassLoader=true)
@Grab(group='com.h2database', module='h2', version='1.3.163')
import org.h2.Driver
@jlgeering
jlgeering / indent.groovy
Created January 16, 2012 17:30
xml indent script
#!/usr/bin/env groovy
def indent(args) {
def cli = new CliBuilder(usage: 'indent.groovy -[h] [-o outputFile] inputFile')
cli.with {
h longOpt: 'help', 'Show usage information'
o longOpt: 'out', args: 1, argName: 'outputFile', 'file to write to (default: stdout)'
}
@jlgeering
jlgeering / showdate.groovy
Created January 16, 2012 17:28
Groovy CliBuilder
# from http://mrhaki.blogspot.com/2009/09/groovy-goodness-parsing-commandline.html
import java.text.*
def showdate(args) {
def cli = new CliBuilder(usage: 'showdate.groovy -[chflms] [date] [prefix]')
// Create the list of options.
cli.with {
h longOpt: 'help', 'Show usage information'
c longOpt: 'format-custom', args: 1, argName: 'format', 'Format date with custom format defined by "format"'
@jlgeering
jlgeering / detectmobilebrowser.js
Created October 17, 2011 07:35
mobile browser detection
(function(a,b){if(/android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|l
@jlgeering
jlgeering / .bash_profile
Created August 16, 2011 08:26
bash config for OS X
. ~/.profile
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi