Skip to content

Instantly share code, notes, and snippets.

View Bernardstanislas's full-sized avatar
🛫
Taking off

Stanislas Bernard Bernardstanislas

🛫
Taking off
View GitHub Profile
@Bernardstanislas
Bernardstanislas / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Bernardstanislas
Bernardstanislas / Circle.cpp
Created October 20, 2014 20:38
Composite pattern issue
#include "Circle.hpp"
#include <iostream>
#include <string>
using namespace std;
Circle::Circle(float x, float y, float r, Circle::Color color) {
myX = x;
myY = y;
myR = r;
@Bernardstanislas
Bernardstanislas / algo.py
Created January 16, 2015 08:32
TP1 de vision par ordinateur
import numpy as np
import cv2
from math import *
import os
databasePath = "db"
outputPath = "output"
def readImage(imagePath):
@Bernardstanislas
Bernardstanislas / README
Created March 5, 2015 19:28
Les biatchs de l'espace
Structure de l'appli :
-- server.js
-- package.json
-- public/
---- index.html
---- js/
------ app.js
---- css/
------ style.css
On Error Resume Next
Sheets("Output").Delete
Sheets.Add After:=Sheets(Sheets.Count)
Set outputSheet = Sheets(Sheets.Count)
outputSheet.Name = "Output" 'name it "output"
@Bernardstanislas
Bernardstanislas / omdb.js
Last active August 29, 2015 14:22
OMDB scrapper
var http = require('http');
var fs = require('fs');
var runningSockets = 1000;
var maxId = 10000000;
var filename = 'dump';
if (http.globalAgent.maxSockets < runningSockets) {
http.globalAgent.maxSockets = runningSockets;
}
@Bernardstanislas
Bernardstanislas / update-all.sh
Created June 18, 2015 09:37
Update focus and focus components
#!/usr/bin/env bash
cd ../../focus
git checkout master
git pull
gulp build
cd ../focus-components
git checkout master
git pull
gulp build
cd ../rodolphe-demo/ui
@Bernardstanislas
Bernardstanislas / cartridge_trad.jsx
Created September 11, 2015 08:43
Translation closure
module.exports = React.createClass({
mixins: [cartridgeBehaviour, mixinTrad],
displayName: 'tdbEntreprise',
cartridgeConfiguration(){
const translation = this.i18n('entreprise.monEntrepriseMin');
return {
cartridge: {component: React.createClass({
render() {return (<div><h2>{translation}</h2></div>); }
})},
actions: {
@Bernardstanislas
Bernardstanislas / promise.js
Created September 15, 2015 11:58
Chain promise
firstService(firstArgs).then((firstData) => {
return secondService(secondArgs).then((secondData) => {
return {
firstKey: firstData,
secondKey: secondData
}
});
});
@Bernardstanislas
Bernardstanislas / .bash_profile
Last active November 26, 2015 13:34
Bash profile
# Home
HOME='/c/Users/sbernard/'
cd $HOME
# Variables
GATEWAY="$(ipconfig | grep -a Passerelle | grep -P -o -a '([0-9]+\.){3}[0-9]+' | head -n 1)"
PROXY="http://172.20.0.9:3128"
KLEE_GATEWAY_ETHERNET="172.20.108.1"
KLEE_GATEWAY_WIFI="172.20.231.1"