Skip to content

Instantly share code, notes, and snippets.

View BOSSoNe0013's full-sized avatar
🏠
Working from home

Cyril Bosselut BOSSoNe0013

🏠
Working from home
View GitHub Profile
@BOSSoNe0013
BOSSoNe0013 / css_rgb_parser.js
Created December 8, 2016 07:49
Parse css rgb color with javascript
var css = 'rgb(128,128,128)';
var channels={};
[channels.red, channels.green, channels.blue] = css.replace(/[rgb\(\) ]/g, '').split(',');
/*
Stepper Motor Joystick Control
This program drives a bipolar stepper motor with DRV8825 driver.
The driver is attached to digital pins 8 - 13 of the Arduino.
The joystick is attached to analog pin A0 (X axis) and digital pin 2 (switch)
The motor rotation is controlled by X axis of the joystick.
The switch brings motor back to its initial position
@BOSSoNe0013
BOSSoNe0013 / trading_balance.py
Created December 28, 2017 15:04
Fetch user's trading balance and deposit address from HitBTC
#!/usr/bin/python
import sys
import os
import requests
import argparse
import configparser
from art import *
argument_parser = argparse.ArgumentParser()
argument_parser.add_argument(
@BOSSoNe0013
BOSSoNe0013 / i2cdetect.py
Last active June 28, 2022 22:09
Simple i2cdetect clone written in Python 3 with smbus library
import sys
import smbus
first = 0x03
last = 0x77
def i2cdetect(bus_id=0):
bus = smbus.SMBus(bus_id)
print('Bus: I2C-{}'.format(bus_id))
# Collection of useful aliases by Cyril BOSSELUT
# This method call the Neofetch app with a random ASCII image
# ASCII images are .txt file stored in ~/.ascii folder
function welcome_message() {
ascii_file=`fd . ~/.ascii -t f -e txt | shuf -n 1`
neofetch --ascii $ascii_file --bar_char '#' '-' --bar_colors 4 1
}
# Set 'history' format to show more useful info
/*
####
## VM's keyboard
####
Board: Arduino Micro
Tested with versions:
Arduino IDE 1.8.12
Libraries (and version used to develop the project):
@BOSSoNe0013
BOSSoNe0013 / watch_screen_status.sh
Last active February 3, 2024 12:24
Watch screen status on GNU/Linux and change devices lightning modes/colors accordingly
#!/bin/bash
# _____ _____ _ _ _ _ _ _
# / ___| / ___| | | | | | | | | | | |
# \ `--. ___ _ __ ___ ___ _ __ \ `--.| |_ __ _| |_ _ _ ___ | | | | __ _| |_ ___| |__ ___ _ __
# `--. \/ __| '__/ _ \/ _ \ '_ \ `--. \ __/ _` | __| | | / __| | |/\| |/ _` | __/ __| '_ \ / _ \ '__|
# /\__/ / (__| | | __/ __/ | | | /\__/ / || (_| | |_| |_| \__ \ \ /\ / (_| | || (__| | | | __/ |
# \____/ \___|_| \___|\___|_| |_| \____/ \__\__,_|\__|\__,_|___/ \/ \/ \__,_|\__\___|_| |_|\___|_|
#
# Copyright (C) 2023 Cyril Bosselut
#
@BOSSoNe0013
BOSSoNe0013 / paswitch.sh
Created May 12, 2023 01:03
I've made this script linked to a keyboard shortcut to easily switch the audio output device used by Linux desktop manager
#!/bin/bash
##########################################################################################################################################
# _____ .___.__ ________ __ __ _________ .__ __ .__ #
# / _ \ __ __ __| _/|__| ____ \_____ \ __ ___/ |_______ __ ___/ |_ / _____/_ _ _|__|/ |_ ____ | |__ ___________ #
# / /_\ \| | \/ __ | | |/ _ \ / | \| | \ __\____ \| | \ __\ \_____ \\ \/ \/ / \ __\/ ___\| | \_/ __ \_ __ \ #
# / | \ | / /_/ | | ( <_> ) / | \ | /| | | |_> > | /| | / \\ /| || | \ \___| Y \ ___/| | \/ #
# \____|__ /____/\____ | |__|\____/ \_______ /____/ |__| | __/|____/ |__| /_______ / \/\_/ |__||__| \___ >___| /\___ >__| #
# \/ \/ \/ |__| \/ \/ \/ \/ #