Skip to content

Instantly share code, notes, and snippets.

View HorlogeSkynet's full-sized avatar

Samuel FORESTIER HorlogeSkynet

View GitHub Profile
@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 / 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 / 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 / BluetoothCLI.sh
Last active November 21, 2016 19:36
BASH script allows user to work with Bluetooth in CLI
#!/bin/bash
clear
echo -e "\n\t\t#Bluetooth script by Horloge-Skynet.\n"
echo -e "\t\033[1;31m/!\ Be sure that your Hardware Bluetooth is running... /!\ \033[0m \n\n"
if [ -d /usr/share/doc/bluez/ ] || [ -d /usr/share/doc/bluez-utils/ ]; then
echo -e "Bluetooth of \033[1m$USER\033[0m on \033[1m$HOSTNAME\033[0m with \033[1m$SHELL\033[0m:"
@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 / gists-backup.py
Last active May 21, 2017 09:46 — forked from joneskoo/gist-backup.py
GitHub's Gists Backup
#!/usr/bin/env python3
import os
import json
import subprocess
import urllib.request
# Just edit this with your GitHub's username
@HorlogeSkynet
HorlogeSkynet / ShellSort.c
Last active August 21, 2017 07:44
A simple program which sorts a text file alphabetically (one string per line), with the Shell sort algorithm
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <errno.h>
#define BUFFERSIZE 64
void shellSort(const char *const);
@HorlogeSkynet
HorlogeSkynet / skyClear.c
Last active August 21, 2017 07:49
A simple C function to clear the terminal without using the bad `system("clear")`
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <sys/wait.h>
void sky_clear(void)
{
@HorlogeSkynet
HorlogeSkynet / waterFountain.ino
Last active August 21, 2017 07:50
Simple code which modelises a water fountain on Arduino
const int switchG = 2;
const int switchA = 3;
const int switchB = 4;
const int switchC = 5;
const int vanne = 6;
int switchGstate = 0;
int switchAstate = 0;
int switchBstate = 0;
int switchCstate = 0;
@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()
{