Skip to content

Instantly share code, notes, and snippets.

View HorlogeSkynet's full-sized avatar

Samuel FORESTIER HorlogeSkynet

View GitHub Profile
@HorlogeSkynet
HorlogeSkynet / Fonts.h
Last active January 9, 2018 09:00
A library for the LCD4884 Arduino shield
#ifndef FONTS_H
#define FONTS_H
#include <avr/pgmspace.h>
const unsigned char font6_8[][6] PROGMEM =
{
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // space
{0x00, 0x00, 0x00, 0x2f, 0x00, 0x00}, // !
@HorlogeSkynet
HorlogeSkynet / helloWorld.asm
Last active November 4, 2017 05:05
A simple "Hello, world !" (debuggable) program for NASM with Linux
; Copyright (c) 1999 Konstantin Boldyshev <[email protected]>
;
; Reviewed by HorlogeSkynet (12/09/16)
;
; "Hello, world !" in assembly language for Linux
; To compile: nasm -f elf64 -g helloWorld.asm
; To link the executable: ld -m elf_x86_64 -g -o helloWorld helloWorld.o
; To run the program: ./helloWorld
; To debug the program: gdb ./helloWorld
@HorlogeSkynet
HorlogeSkynet / createAccessPoint.sh
Last active April 14, 2020 15:49
Script for automatic creation and shutdown of a Wifi Access Point with 'create_ap'
#!/usr/bin/env bash
# @Author: Horloge-Skynet
# @Created: 2016-11-21
# @Created: 2020-04-14
# @Brief: Script for automatic creation and shutdown of a Wifi Access Point with 'create_ap'
## Some Wifi parameters ##
SSID='SkyWifi'
@HorlogeSkynet
HorlogeSkynet / PICool.sh
Last active April 14, 2020 15:56
Script for a coloring / cooling system temperature-dependent for Raspberry PI
#!/bin/bash
# @Author: Horloge-Skynet
# @Created: 2014-01-26
# @Created: 2020-04-14
# @Brief: Script for a coloring / cooling system temperature-dependent for Raspberry PI
## GPIO path ##
GPIO_PATH=/usr/local/bin/gpio
@HorlogeSkynet
HorlogeSkynet / skyParser.c
Last active May 25, 2019 13:46
A simple C string parser for CLI programs
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <inttypes.h>
#define BUFFER 1024
@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 / 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 / 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 / ITERRobot2014.c
Last active May 25, 2019 13:44
Our code for the ITER Robot 2014 edition
#include "LSA-lib.nxc" //http://www.mindsensors.com/index.php?module=documents&JAS_DocumentManager_op=viewDocument&JAS_Document_id=219
#define LeftMotor OUT_A
#define RightMotor OUT_C
#define BothMotors OUT_AC
#define Plateforme OUT_B
#define Capteur_Couleur IN_1
#define Capteur_Ligne IN_2
#define ADDR 0x14
@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;