Skip to content

Instantly share code, notes, and snippets.

View lululombard's full-sized avatar

lululombard

View GitHub Profile
@lululombard
lululombard / main.py
Created July 18, 2022 15:59
Pico solar tracker
from machine import Pin, ADC, PWM
import utime
MAX_DELTA_ALIGNED = 4000
led = Pin(25, Pin.OUT)
servos = {
'pan': {
'min': 1000,
@lululombard
lululombard / piecewise_linear_interpolate.cpp
Created July 6, 2022 03:10
Piecewise linear interpolation in C++
#include <iostream>
#include <map>
using namespace std;
float piecewise_linear_interpolate(map<float, float> value_mappings, float input);
int main() {
map<float, float> voltage_to_percent_mapping {
{ 09.5, 0.0 },
@lululombard
lululombard / CompressedResponse.php
Last active April 22, 2022 13:18
Brotli/gzip/deflate support for Laravel Vapor
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
@lululombard
lululombard / senseo.php
Created August 4, 2018 22:02
Senseo PHP file (old stuff)
<?php
// HEADER CONFIG FILE
$screen_name = "senseo"; // The screen name
$allowed = array("s", "c", "b", "r", "a"); // What you allow to be send over serial
$requireroot = true; // True = you need to add www-data to sudoers file without password. False = you need to cron your interface each minute to 777
$interface = "ttyUSB0"; // Your serial interface, witout /dev/
// You should not touch this.
if ($requireroot == 1) {
@lululombard
lululombard / MoreMobs.java
Created June 7, 2018 21:32
Source of KingHardcore
package com.lululombard.kinghardcore;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.ConcurrentModificationException;
import java.util.List;
import java.util.Random;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
@lululombard
lululombard / cloudSettings
Created February 25, 2018 11:50
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-02-25T11:49:41.593Z","extensionVersion":"v2.8.7"}