Skip to content

Instantly share code, notes, and snippets.

@hemalchevli
hemalchevli / bluepill.cfg
Last active July 24, 2023 11:57
OpenOCD config file for Bluepill STM32F103C8T6
#source [find interface/stlink-v2-1.cfg]
source [find interface/stlink-v2.cfg]
transport select hla_swd
source [find target/stm32f1x.cfg]
#reset_config srst_only
reset_config none separate
@EvAlex
EvAlex / color.ts
Created April 20, 2017 06:52
TypeScript Color class, useful to manipulate rgba components and convert to rga/rgba/hex
export const RGB_COLOR_REGEX = /\((\d+),\s*(\d+),\s*(\d+)(,\s*(\d*.\d*))?\)/;
export class Color {
public r: number;
public g: number;
public b: number;
public a: number;
constructor()
constructor(colorStr?: string)
@holazt
holazt / Docker CE on Linux Mint 18.1
Created April 13, 2017 08:27
Docker CE on Linux Mint 18.1
Here are the instructions to installing Docker CE on Linux Mint 18.1 Serena.
Step1. `sudo apt-get install apt-transport-https ca-certificates curl software-properties-common`
Step2. `curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -`
The following line in the SOURCE automatically determines the distribution, which is Serena,
but there are no Linux Mint packages for Docker. You have to change it to the matching Ubuntu distribution.
FYI Linux Mint Serena is based on Ubuntu 16.04 Xenial.
@DzikuVx
DzikuVx / pid_controller.js
Created January 21, 2017 20:54
Simple JavaScript PID controller
'use strict';
var classes = classes || {};
classes.PidController = function () {
var self = {},
privateScope = {};
/**
@sbose78
sbose78 / update-version-package.sh
Last active April 11, 2024 19:36
Pre-commit hook to update package.json
#!/bin/bash
set -e
update_version(){
if [[ "$DONT_BUMP_VERSION" -ne "1" ]]
then
echo " Bumping version.. "
else
echo "Version will not be bumped since variable DONT_BUMP_VERSION is set."
exit 0
@bigjosh
bigjosh / main.c
Last active May 13, 2018 21:19
PWM Motor control code for AIRBOAT running on ATTINY10
/*
* Attiny10 AIRBOAT PWM Motor control code
*
* Created: 12/2/2016 6:17:47 PM
* Author : josh
*/
#include <avr/io.h>
#include <util/delay.h>
@adnbr
adnbr / attiny13-adc-pwm.c
Last active June 12, 2024 10:32
ADC input directly to PWM output, on an ATtiny13.
/* ---------------------------------------------------------------------
* PWM LED Brightness control for ATtiny13.
* Datasheet for ATtiny13: http://www.atmel.com/images/doc2535.pdf
*
* Pin configuration -
* PB1/OC0B: LED output (Pin 6)
* PB2/ADC1: Potentiometer input (Pin 7)
*
* ~100 bytes.
*
// Written by Nick Gammon
// February 2011
/**
* Send arbitrary number of bits at whatever clock rate (tested at 500 KHZ and 500 HZ).
* This script will capture the SPI bytes, when a '\n' is recieved it will then output
* the captured byte stream via the serial.
*/
#include <SPI.h>