Skip to content

Instantly share code, notes, and snippets.

View HorlogeSkynet's full-sized avatar

Samuel FORESTIER HorlogeSkynet

View GitHub Profile
@HorlogeSkynet
HorlogeSkynet / randomGeneration.ino
Last active August 21, 2017 07:54
Random number generation on Arduino helped by many extern sensors
#include "math.h"
#include "Wire.h"
#include "LCD4884.h"
#include "Adafruit_BMP085.h"
#include "TinyDHT.h"
#include "DS1302.h"
#include "Ultrasonic.h"
#define TIME 300000
@HorlogeSkynet
HorlogeSkynet / SudokuResolution.c
Last active October 11, 2016 18:04
A program which resolves a Sudoku grid written down in a text file (only the first grid, at the head of the file, is computed)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#define SIZE 9
#define MINNBVALUES 17
#define FIRST -9999
@HorlogeSkynet
HorlogeSkynet / howManyDays.c
Last active August 21, 2017 07:54
Count the numbers of days between a date in the past and today
#include <stdio.h>
#include <time.h>
#define NBJOURSANNEE 365
#define NBJOURSANNEEBIS 366
#define NBMOISANNEE 12
#define NBJOURSMOIS30 30
#define NBJOURSMOIS31 31
@HorlogeSkynet
HorlogeSkynet / SnakeArduino.ino
Last active October 23, 2023 10:16
Simple Snake for LCD4884 screen on Arduino
//!\\ Visit <https://samuel.forestier.app/blog/hacking/snake-with-lcd4884-shield> //!\\
#include "LCD4884.h"
///////////User's Parameters
#define USE_PUSHBUTTONS 1
#define USE_BUZZER 1
//PIN parameters
@HorlogeSkynet
HorlogeSkynet / conkyrc.lua
Last active October 23, 2023 10:14
My ConkyRC adapted to LUA syntax (deprecated)
-- HorlogeSkynet's Conky Script
-- <https://samuel.forestier.app/blog/tutorials/paramtrer-conky-sous-crunchbang>
-- Fonts needed (download and move them in `~/.fonts/`) :
-- * <https://www.dafont.com/radio-space.font>
-- * <https://www.dafont.com/style-bats.font>
-- * <https://www.dafont.com/pizzadude-bullets.font>
-- THIS CONKYRC IS DEPRECATED. MAINTAINED VERSION : <https://git.forestier.app/HorlogeSkynet/SimpleConkyScript>
@HorlogeSkynet
HorlogeSkynet / matrixInversion.py
Last active September 24, 2017 02:23
Simple Python matrix inversion script
#!/usr/bin/env python3
# -*-coding:utf-8 -*
"""
@author: HorlogeSkynet
"""
import os
@HorlogeSkynet
HorlogeSkynet / ArduinoCommunication.pde
Last active June 3, 2021 14:11
Get data from Arduino with serial port on Processing
/* Programme nécessaire, et donc réalisé, dans le but de modéliser un projet TIPE */
/* Année scolaire 2015 - 2016 */
import processing.serial.*;
int indArduino;
Serial portSerie;
@HorlogeSkynet
HorlogeSkynet / EnumerationProcessing.pde
Created May 27, 2016 16:05
How to declare and use an enumeration-like type on Processing
// Notre dictionnaire qui jouera le rôle d'énumération...
// Défini ici en tant que variable globale pour avoir la même "portée" qu'une énumération "classique"
IntDict monEnumeration;
void setup()
{
// On crée une instance du dictionnaire ...
monEnumeration = new IntDict();
@HorlogeSkynet
HorlogeSkynet / randomPixelisation.basic
Last active August 21, 2017 07:52
Code for TI-89 that simulates a random pixalisation
Prgm
setGraph("axes", "off")
ClrDraw
38->x
79->y
0->t
While t < 5000
@HorlogeSkynet
HorlogeSkynet / blackMagic.c
Last active August 21, 2017 07:52
Simple code to show a pretty funny thing in C with pointers
#include <stdio.h>
#define MAINPARAMETERS 0x10
void blackMagic(int valeur)
{
long *p;
p = ((long*)((long)&p + 0x24 + MAINPARAMETERS));
*p = valeur;