Skip to content

Instantly share code, notes, and snippets.

View ArthurSonzogni's full-sized avatar
🎯
Focusing

Arthur Sonzogni ArthurSonzogni

🎯
Focusing
View GitHub Profile
@ArthurSonzogni
ArthurSonzogni / create_bitbucket_repositories.sh
Created March 8, 2016 11:46
Use bitbucket REST api to create and update all git repository in the directory. ( push into bitbucket team )
#!/bin/bash
echo -n "username in lowercase : "
read username
echo -n "password : "
read password
echo -n "team : "
read team
for r in $(echo */)
do
repo=${r%%/}
#ifndef SATURATE_CAST_HPP
#define SATURATE_CAST_HPP
#include <cmath>
// because C++ doesn't allow partial function
// specialization, we must use static method
// from specialized class
//-----------
@ArthurSonzogni
ArthurSonzogni / Print.hpp
Last active March 3, 2016 15:43
qdebug() like object that avoid interleaving issues in a multiprocess / multithread environment.
/* ---------------------------------------------------------------------------
* ** This software is in the public domain, furnished "as is", without technical
* ** support, and with no warranty, express or implied, as to its usefulness for
* ** any purpose.
* **
* ** The file provide a way to avoid interleaved printing in a multithreaded
* ** environment. It works like qDebug() for the Qt framework
* **
* ** Usage :
* ** Print() << " The debug value = " << 42;
@ArthurSonzogni
ArthurSonzogni / Chemical formula parser
Last active August 29, 2015 14:18
Parse chemical expression (ie : (CH4)2HeLi )
#include <iostream>
#include <sstream>
typedef std::map<std::string,int> chemicalComposition;
void transferChemical(chemicalComposition& left, chemicalComposition& right)
{
for(chemicalComposition::iterator it = right.begin(); it!=right.end(); ++it)
left[it->first] += it->second;
@ArthurSonzogni
ArthurSonzogni / .vimrc
Created November 25, 2014 12:37
minimal acceptable vim
set nocompatible
" map jj to escape
imap jj <Esc>
" activate mouse control
set mouse=a