Skip to content

Instantly share code, notes, and snippets.

@IGI-111
IGI-111 / Makefile
Created October 10, 2014 08:11
simple makefile for system programming
CC = g++ -std=c++0x
EXECUTABLE := exo_01.run
INCLUDE := include
SOURCES := $(wildcard dirsignal/*.cxx)
OBJECTS := $(patsubst dirsignal/%.cxx, %.o, $(SOURCES))
all: $(EXECUTABLE)
clean :
@IGI-111
IGI-111 / gestion_mysql.sql
Created October 28, 2014 20:40
Base de donnée pour TP JDBC
DROP TABLE IF EXISTS ETUDIANT;
DROP TABLE IF EXISTS PROF;
DROP TABLE IF EXISTS MODULE;
DROP TABLE IF EXISTS ENSEIGNT;
DROP TABLE IF EXISTS NOTATION;
CREATE TABLE ETUDIANT
(
NUM_ET INT(6) PRIMARY KEY AUTO_INCREMENT,
NOM_ET VARCHAR(20),
@IGI-111
IGI-111 / options.cxx
Last active August 29, 2015 14:18
Option handling
#include <string>
#include <functional>
#include <map>
#include <iostream>
#include <memory>
template <typename T> class TypedOption;
class Option
{
@IGI-111
IGI-111 / Makefile
Created October 19, 2015 06:58
Compilation de colourist sur les PC ENSIMAG
##################################################
# Project name
TARGET = colorist
# Compiler and flags
CC = LD_LIBRARY_PATH="/opt/gcc-4.9.3/lib" /opt/gcc-4.9.3/bin/g++
CFLAGS = -Wall -g -std=c++14 -I /opt/gcc-4.9.3/include -L /opt/gcc-4.9.3/lib
# Catch unit testing
@IGI-111
IGI-111 / levenstein.cpp
Created October 20, 2016 15:02
Levenstein distance
#include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <utility>
#include <vector>
namespace {
using Iter = std::string::const_iterator;
@IGI-111
IGI-111 / qr-braille.js
Created December 5, 2016 13:43
Make a QR code with braille characters.
const qr = require('qrcode');
const Canvas = require('drawille');
qr.drawBitArray(process.argv[2], (err,bits,width) => {
if(err){
console.error(err);
return;
}
let height = Math.ceil(bits.length / width);
#include <stdlib.h>
#include <string.h>
#include "term.h"
/* Eterm */
static const char *Eterm_keys[] = {
"\033[11~","\033[12~","\033[13~","\033[14~","\033[15~","\033[17~","\033[18~","\033[19~","\033[20~","\033[21~","\033[23~","\033[24~","\033[2~","\033[3~","\033[7~","\033[8~","\033[5~","\033[6~","\033[A","\033[B","\033[D","\033[C", 0
};
static const char *Eterm_funcs[] = {
@IGI-111
IGI-111 / pyramid.rs
Last active August 29, 2017 08:32
Shortest pyramid path
use std::env;
use std::io::Read;
use std::fs::File;
use std::cmp;
pub fn main() {
let args: Vec<String> = env::args().collect();
let mut file = File::open(&args[1]).unwrap();
let mut contents = String::new();
file.read_to_string(&mut contents).unwrap();
@IGI-111
IGI-111 / category_theory.md
Last active September 12, 2023 19:32
"category theory for programmers" blog post series parsed into markdown and formatted in a pdf

Category Theory for Programmers: The Preface

Table of Contents

Part One

@IGI-111
IGI-111 / vigenere.js
Created October 11, 2017 12:42
Vigenere cypher solver
const fs = require('fs');
const englishFrequency = [
0.08167,
0.01492,
0.02782,
0.04253,
0.12702,
0.02228,
0.02015,