Skip to content

Instantly share code, notes, and snippets.

View oktomus's full-sized avatar

Kevin Masson oktomus

View GitHub Profile
@oktomus
oktomus / index.html
Last active March 12, 2017 21:36
Web JS Perlin noise
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="main.js"></script>
<style type="text/css">
html, body {
margin: 0px;
}
@oktomus
oktomus / Makefile
Created February 12, 2017 11:31
Makefile : executable for each source file
CXX=g++
FLAGS=-Wall
LFLAGS=-lglut -lGL -lGLU
SRC=.
EXEC=.
SRCS=$(wildcard $(SRC)/*.cpp)
EXECS=$(SRCS:$(SRC)/%.cpp=$(EXEC)/%.out)
@oktomus
oktomus / Huffman.java
Last active February 12, 2017 11:32
Huffman compression in JAVA
import java.io.*;
import java.util.*;
public class Huffman{
/**
* Représente un noeud pour un arbre binaire
*
* Peut avoir une valeur, un nombre d'occurence, un fils gauche et un fils droit
@oktomus
oktomus / Time.php
Created February 26, 2016 10:11
Calculate the reponse time of your webpage, useful to check SQL request time.
<?php
namespace app;
class Time
{
private $startTime, $reponseTime;
public function __construct(){
$this->startTime = microtime(true);
@oktomus
oktomus / insertSort.sh
Created December 13, 2015 11:28
Sort an array while inserting by ascending order in bash
read N
read tab[0]
for (( i=1; i<N; i++ )); do
read x
j=0
k=$i
while [ $k -gt $j ]
do
m=$((($j+$k)/2))
if [ $x -lt ${tab[$m]} ]; then