Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Convert HEX color to RGBA.
*
* @param string $hex_color The HEX color code (e.g., '#FF0000').
* @param float $opacity The opacity level (0 to 1).
*
* @return string The RGBA color format.
*/
@ancientstraits
ancientstraits / GalactechSensor.ino
Created February 7, 2025 01:40
Galactech Teensy 4.0 Light Sensor
#include <Wire.h>
void setup() {
// put your setup code here, to run once:
pinMode(0, OUTPUT);
Wire.begin();
Serial.begin(115200);
Wire.beginTransmission(0x52);
// MAIN_CTRL (only turn on proximity sensor)
@lvanasse
lvanasse / ci-other.log
Created February 7, 2025 01:40
[other] CI Log for nuttx @ 2ebdd72487a96879b3f8689e0b35ae5f7a49973a / nuttx-apps @ f139e56cd62a30d6edcd7207c7e4cbc6e9b8b7d1
Script started on 2025-02-07 01:27:00+00:00 [COMMAND="/home/ludovic/nuttx-release/run-job.sh other" <not executed on terminal>]
Now running https://github.com/lupyuen/nuttx-release/blob/main/run-job.sh
Called by https://github.com/lupyuen/nuttx-release/blob/main/run-ci.sh
+ job=other
+ neofetch
.-/+oossssoo+/-.
`:+ssssssssssssssssss+:`
-+ssssssssssssssssssyyssss+-
.ossssssssssssssssssdMMMNysssso.
/ssssssssssshdmmNNmmyNMMMMhssssss/
@tohagan
tohagan / README.md
Created February 7, 2025 01:40
Upload image, recommend cropping scale and offsets (AI), allow the user to adjust the final cropping to a fixed image size.

Example code from GPT 4o-mini to support capturing images from a user of a fixed size.

  • File Upload: The user uploads an image, which is read using a FileReader.
  • SmartCrop: Once the image is loaded, SmartCrop analyzes it and provides a suggested cropping area based on the preset final dimensions.
  • Cropper.js: The suggested crop area is set in Cropper.js, allowing the user to see the recommended crop and make adjustments. The aspect ratio is fixed to the desired dimensions.
  • Cropping: When the user clicks the "Crop" button, the cropped image is drawn onto a canvas with the specified final dimensions.
@DolphinOfficial
DolphinOfficial / PostShutdownFullLog.txt
Created February 7, 2025 01:39
Text file created by Roblox
-- AH POST-SERVER LOGS --
-- ServerID: 25673727-8116-4363-aed0-0fc391f45d95
-- Server started: February 06, 2025 11:24 PM UTC | Server uptime: 7285 seconds
------------------ LOADB LOGS ------------------
{
}
ventas={
'Month': ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
'Revenue': [200, 220, 250, 275, 300, 320, 350, 370, 400, 420, 450, 475]
}
@diegofcornejo
diegofcornejo / 1. MicroK8S Ubuntu.md
Created February 7, 2025 01:38
How to Install MicroK8S on Ubuntu 24.04 (Single Node)

How to Install MicroK8S on Ubuntu 24.04 (Single Node)

Install MicroK8S

sudo snap install microk8s --classic

Add the current user to the microk8s group

async function download_files(files) {
async function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
for (const [index, file] of files.entries()) {
console.log('iteration: ' + files);
try {
var a = document.createElement('a');
a.href = file.download;
a.target = "_blank";
@DolphinOfficial
DolphinOfficial / PostShutdownFullLog.txt
Created February 7, 2025 01:36
Text file created by Roblox
-- AH POST-SERVER LOGS --
-- ServerID: 7794316f-0824-4c56-b6fc-e65d63ac7fd3
-- Server started: February 07, 2025 01:36 AM UTC | Server uptime: 4 seconds
------------------ LOADB LOGS ------------------
{
}
@DolphinOfficial
DolphinOfficial / PostShutdownFullLog.txt
Created February 7, 2025 01:35
Text file created by Roblox
-- AH POST-SERVER LOGS --
-- ServerID: 1e2274f9-4897-4698-9a35-54f17a570814
-- Server started: February 07, 2025 01:31 AM UTC | Server uptime: 274 seconds
------------------ LOADB LOGS ------------------
{
}