Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@RicoElectrico
RicoElectrico / termometr.c
Created June 2, 2018 19:09
Atmega8 LCD thermometer
#include <avr/io.h>
#include <avr/pgmspace.h>
#include "lcd.h" // HD44780U LCD library, Peter Fleury
#include <avr/interrupt.h>
#include <avr/sleep.h>
#include <stdbool.h>
#define F_CPU 1000000
void iprint(int n)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE qgis_style>
<qgis_style version="1">
<symbols/>
<colorramps>
<colorramp type="gradient" name="Turbo" favorite="1">
<prop k="color1" v="48,18,59,255"/>
<prop k="color2" v="122,4,2,255"/>
<prop k="discrete" v="0"/>
<prop k="rampType" v="gradient"/>
<prop k="stops" v="0.00392;49,21,66,255:0.00784;50,24,74,255:0.01176;52,27,81,255:0.01569;53,30,88,255:0.01961;54,33,95,255:0.02353;55,35,101,255:0.02745;56,38,108,255:0.03137;57,41,114,255:0.03529;58,44,121,255:0.03922;59,47,127,255:0.04314;60,50,133,255:0.04706;60,53,139,255:0.05098;61,55,145,255:0.05490;62,58,150,255:0.05882;63,61,156,255:0.06275;64,64,161,255:0.06667;64,67,166,255:0.07059;65,69,171,255:0.07451;65,72,176,255:0.07843;66,75,181,255:0.08235;67,78,186,255:0.08627;67,80,190,255:0.09020;67,83,194,255:0.09412;68,86,199,255:0.09804;68,88,203,255:0.10196;69,91,206,255:0.10588;69,94,210,255:0.10980;69,96,214,255:0.11373;69,99,217,255:0.11765;70,102,221,255:0.12157;70,104,224,255:0.12549;70,107,227,255:0.12941;
@RicoElectrico
RicoElectrico / normalize_number.sh
Last active February 25, 2025 18:11
Script to format phone numbers for OSM
#!/bin/bash
# A script to paste a phone number into an OSM editor (JOSM, iD etc.) in a normalized form.
# Before running ensure you have xdotool and xclip installed. Make this file executable (chmod +x).
# Bind this script to a custom keyboard shortcut in your desktop environment.
# Then, before using, first copy a number to the clipboard and focus the cursor in a relevant field in your OSM editor.
# Adjust this to your country's international calling prefix
COUNTRY_CODE="+48"
@RicoElectrico
RicoElectrico / find_quadratic_coeffs.py
Last active April 12, 2025 13:00
A method to find coefficients of a quadratic given 3 points in 6 multiplies and 2 divisions
def calculate_quadratic_coefficients(points):
# Extract x and y values from the points
x1, y1 = points[0]
x2, y2 = points[1]
x3, y3 = points[2]
# Set up the determinant of the matrix
D = (x1**2 * (x2 - x3) +
x2**2 * (x3 - x1) +
x3**2 * (x1 - x2))