Skip to content

Instantly share code, notes, and snippets.

View macmata's full-sized avatar

Alexandre Leblanc macmata

  • Montreal
  • 12:56 (UTC -04:00)
View GitHub Profile
from requests_oauthlib import OAuth2Session
from flask import Flask, request, redirect, session, url_for
from flask.json import jsonify
import os
app = Flask(__name__)
# This information is obtained upon registration of a new GitHub
client_id = "<your client key>"
for row in csv_f:
group_3.append(row[2])
peut devenir
group_3 = [row[2] for row in csv_f]
CC=g++
CFLAGS=-c -Wall -Wextra
LDFLAGS=
SOURCES=tp3.cpp astar.cpp carte.cpp coodonnee.cpp etat.cpp sommet.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=tp3
all : $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) -o $@
@macmata
macmata / gist:bb2542d9463f79300225
Last active August 29, 2015 14:21
Doxygen cmake
# add a target to generate API documentation with Doxygen
find_package(Doxygen)
if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target(doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
endif(DOXYGEN_FOUND)
@macmata
macmata / gist:b7593f85bb846acfae74
Created June 8, 2015 17:03
kcachegrind for mac
brew install graphviz
brew install qt
git clone git://anongit.kde.org/kcachegrind
cd kcachegrind/qcachegrind
qmake -spec 'macx-g++'; make
copy generated qcachegrind.app to your Applications folder
#how to build
#sudo docker build -t apache2 .
#how to run
#sudo docker run -p 8080:8080 --name apache_process -d apache2 /usr/sbin/apache2ctl -D FOREGROUND
FROM ubuntu:14.04
MAINTAINER Alexadnre Leblanc
RUN apt-get update
brew install caskroom/cask/brew-cask
brew install zsh wget python python3 jruby ruby archey autoconf autogen automake cmake doxygen gdbm git gmp htop-osx jruby libtool libunistring libyaml lzo nmap openssl openvpn p7zip pandoc pkg-config readline ssh-copy-id
brew install vim --with-perl --with-ruby --with-python3 --with-features=huge
brew install findutils --default-names
brew install coreutils --default-names
brew cask install iterm2 virtualbox vagrant vagrant-manager dropbox google-chrome slack transmit vlc mactex
#include <iostream>
#include "server.h"
static void ev_handler(struct mg_connection *nc, int ev, void *ev_data) {
switch (ev) {
case MG_EV_RECV:
// do something
mg_printf(nc, "alsothis_1");
break;
case MG_EV_HTTP_REQUEST:
@macmata
macmata / gist:a4bbe4cefb0efd844483
Created December 14, 2015 03:53
Waveshare-Raspberry-Resistive-Interface-Rapsberry-pi
http://www.wvshare.com/product/3.2inch-RPi-LCD-B.htm
http://www.amazon.com/Waveshare-Raspberry-Resistive-Interface-Rapsberry-pi/dp/B00N0SNVQE
I have found that the initialization string is very close to fb_ili9340 driver, so after few days of testing I found this configuration is pretty stable
1) Use FBTFT drivers built into the kernel
sudo REPO_URI=https://github.com/notro/rpi-firmware BRANCH=builtin rpi-update
sudo reboot
2) After rebooting, check that SPI was created
@macmata
macmata / gist:415cdc46fd25ba3ba0f5
Created January 12, 2016 02:50
Turn Off the built in apache on OSx
Turn Off the built in apache on OSx
Apr 1, 2013, 1 minute read, 191 words
Slack - a messaging app for teams, integrating with the tools you already use.ads via Carbon
There are a handful of reasons why you would want to turn off the built in apache on OSx, you might have installed your own version, maybe you don't use apache and it is interfering with something else, whatever the reason there is one command you need to run to turn it off.
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apa