Skip to content

Instantly share code, notes, and snippets.

View M0dM's full-sized avatar

Benoit Brayer M0dM

  • Alma SCOP
  • Grenoble
  • 02:47 (UTC +02:00)
View GitHub Profile
@iboumedien
iboumedien / elasticsearch-analysis-french-stopwords
Created November 17, 2015 10:43 — forked from nboire/elasticsearch-analysis-french-stopwords
Elasticsearch : override stopwords list for specific "language" analyzer ( exemple with "french" list )
# delete all data
curl -XDELETE localhost:9200/test
# create an index and define specific french stop_words
curl -XPUT localhost:9200/test -d '{
"settings" : {
"index" : {
"analysis" : {
"analyzer" : {
"french" : {
#!/usr/bin/python
# A simple script to convert an LDIF file to DOT format for drawing graphs.
# Copyright 2009 Marcin Owsiany <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,

Creating a two way sync between a Github repository and Subversion

Another git <> svn post?

As many of you know I have been on a quest to get Jetpack core development moved from the WordPress.org Subversion (svn) repository to Github (git). As part of this process I setup an experimental Jetpack repository to see how synchronization works between git and svn. Lets just clear the air right now and say not well, not well at all. This is due to how git and svn each store their respective histories. But! I think I finally have it figure out.

Backfill

I wrote an article a couple months ago entitled Creating a synchronized Github fork of a WordPress.org Subversion plugin repository. This article is great (and still a recommended read) if you are only doing synchronization b

@dreispt
dreispt / gist:b30d5d737d32dbd1b5b5
Last active February 5, 2019 18:38
Odoo minimal dependencies
sudo apt-get install python-virtualenv python-dev postgresql-client libldap2-dev libsasl2-dev libssl-dev libpq-dev
# python-virtualenv - virtualenv
# python-dev - compile python
# libldap2-dev libsasl2-dev libssl-dev - for python-ldap
# libpq-dev - psycopg2
../ootest-env/bin/python setup.py develop
../ootest-env/bin/pip install pypdf # https://github.com/odoo/odoo/pull/1757
$ sudo apt-get install postgresql
@miguelmota
miguelmota / buffer.js
Created August 24, 2014 18:33
Node.js Buffer to ArrayBuffer
// @credit: http://stackoverflow.com/questions/8609289/convert-a-binary-nodejs-buffer-to-javascript-arraybuffer
// From Buffer to ArrayBuffer:
function toArrayBuffer(buffer) {
var ab = new ArrayBuffer(buffer.length);
var view = new Uint8Array(ab);
for (var i = 0; i < buffer.length; ++i) {
view[i] = buffer[i];
}
@sepehr
sepehr / gitignore2svnignore.sh
Created June 24, 2014 08:30 — forked from iegik/gitignore2svnignore.sh
Shell: Convert .svnignore to .gitignore & viceversa
#!/bin/bash
cat .gitignore | sed 's/^/\.\//g;s/\(.*\)\/\([0-9a-zA-Z\*\?\.]*\)$/svn propedit svn:ignore "\2" \1 /mg' | bash
@staltz
staltz / introrx.md
Last active May 12, 2026 01:57
The introduction to Reactive Programming you've been missing
@postrational
postrational / gunicorn_start.bash
Last active April 4, 2024 12:48
Example of how to set up Django on Nginx with Gunicorn and supervisordhttp://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
#!/bin/bash
NAME="hello_app" # Name of the application
DJANGODIR=/webapps/hello_django/hello # Django project directory
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket
USER=hello # the user to run as
GROUP=webapps # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name
@schlamar
schlamar / processify.py
Last active December 4, 2025 10:37
processify
import os
import sys
import traceback
from functools import wraps
from multiprocessing import Process, Queue
def processify(func):
'''Decorator to run a function as a process.
Be sure that every argument and the return value