Skip to content

Instantly share code, notes, and snippets.

View HorlogeSkynet's full-sized avatar

Samuel FORESTIER HorlogeSkynet

View GitHub Profile
@HorlogeSkynet
HorlogeSkynet / selfReliantParasol.ino
Last active August 21, 2017 07:50
Simple code which modelises a self reliant parasol on Arduino
const int relais = 4;
const int switch_haut = 3;
const int switch_bas = 2;
const int photoresistance = A0;
const int anemometre = A1;
void setup()
{
@HorlogeSkynet
HorlogeSkynet / Duemilanove.ino
Last active November 21, 2016 19:57
Two Arduino programs for GreenHouse system
#include "LCD4884.h"
//#include "Wire.h"
#include "Servo.h"
Servo servo;
//#include "Adafruit_BMP085.h"
//Adafruit_BMP085 bmp;
#define DEBOUNCE_MAX 15
#define DEBOUNCE_ON 10
#define DEBOUNCE_OFF 3
@HorlogeSkynet
HorlogeSkynet / buyMenu.lua
Created September 11, 2016 00:19
buyMenu.lua file modified (Just Cause 2 Multiplayer)
class 'BuyMenu'
class 'BuyMenuEntry'
function BuyMenuEntry:__init( model_id, price, entry_type )
self.model_id = model_id
self.price = price
self.entry_type = entry_type
end
function BuyMenuEntry:GetPrice()
@HorlogeSkynet
HorlogeSkynet / primeNumbersInterval.py
Last active September 24, 2017 02:26
A simple Python script to display prime numbers present within a given interval
#!/usr/bin/env python3
# -*-coding:utf-8 -*
from math import sqrt
def premier(borne1, borne2):
nombresPremiers = 0
@HorlogeSkynet
HorlogeSkynet / puzzledNumber.c
Last active September 24, 2017 02:38
A simple C program to decompose a number in powers of 10
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <inttypes.h>
#define POWER(x, y) (long int)pow(x, (float)y)
uint8_t* puzzledNumber(int32_t number, uint16_t *size)
@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;
@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 / 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 / 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 / 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