Skip to content

Instantly share code, notes, and snippets.

View antoineMoPa's full-sized avatar

Antoine M-P antoineMoPa

  • Sherbrooke, Québec, Canada
View GitHub Profile
@antoineMoPa
antoineMoPa / gist:5277081
Created March 30, 2013 15:21
Small app menu for X that launches user defined commands. I created it when I used 9wm. I wanted a lightweight application launcher. This code can be useful to people who wonder how to create X applications without any widget library such as GTK or QT.
// main.c
//
// Copyright 2012 Antoine Morin-Paulhus <[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,
@antoineMoPa
antoineMoPa / shortcutLib.js
Last active December 20, 2015 14:49
Small javascript library that does most of the things I need from jQuery
var shortcutLib;
if(typeof q !== 'undefined'){
shortcutLib.previousQ = q;
}
(function(q){
var rootElement = document;
@antoineMoPa
antoineMoPa / ao_example.cpp
Created October 5, 2013 21:14
Something to get you started with libao with c++
/*
*
* ao_example.cpp
*
* Written by Stan Seibert - July 2001<
* Antoine Morin-Paulhus changed a line in 2013 for it to compile in c++
*
* Legal Terms:
*
@antoineMoPa
antoineMoPa / count-ip.py
Created March 12, 2015 00:21
Count the number of times every IP was found in apache log files
# Counts the number of times an IP was found in all the .log files in the folder
# first argument : log file name
# second argument : minimum number of error to print an ip
import sys
import os
import re
def extract_ips():
os.system('echo "" > all.data')
@antoineMoPa
antoineMoPa / fa-icons-list.txt
Created March 24, 2015 15:33
Font-Awesome Icons List for version 4.3.0
fa-glass
fa-music
fa-search
fa-envelope-o
fa-heart
fa-star
fa-star-o
fa-user
fa-film
fa-th-large
# Pixel sorts an image
# Takes 2 arguments:
# $1 is the original filename
# $2 is the field to order:
# 1 r
# 2 g
# 3 b
# 4 r + g + b
# Takes 2 arguments:
# $1 is the original filename
# $2 is the field to order:
# 1 r
# 2 g
# 3 b
# 4 r + g + b
# Example:
# sh sort.sh me.jpg 4
@antoineMoPa
antoineMoPa / gnucap-gnuplot-basics.md
Created December 8, 2015 02:03
Gnucap + Gnuplot

gnucap file:

* Hello :D this is a file created to be read by gnucap in batch mode

* circuit definition (netlist)
R1 0 1 100k
* This one has an initial voltage
C1 1 2 680n IC=12
L1 2 0 20m
/*
Met les notes en pourcentages dans la grille d'évaluation de www.gel.usherbrooke.ca
UTILISATION: Il faut ouvrir la page de l'horaire (dans un nouvel onglet) et faire rouler le code dans la console javascript.
Copyright Antoine Morin-Paulhus 2015
Vous pouvez utiliser, modifier et distribuer ce script sous les termes de la license GPL disponible ici:
http://www.gnu.org/licenses/gpl-3.0.en.html
*/
@antoineMoPa
antoineMoPa / latex-tikz-example.tex
Created December 15, 2015 22:56
Basics of tikz (lines, plots, grids)
\section{Example drawings with tikz}
% cremeronline.com/LaTeX/minimaltikz.pdf
% You have to \usepackage{tikz}
\begin{figure}[h]
\begin{center}
\begin{tikzpicture}
\draw[help lines] (0,0) grid (2,4);
\draw (0,1) --(1,3.666) --(2,1) -- (2,0) --(0,0) -- (0,1);
\draw [->] (3.5,0.5) -- (6,0.5);
\draw [|->] (3.5,1) -- (6,1);