Skip to content

Instantly share code, notes, and snippets.

View Yuri-M-Dias's full-sized avatar
🛰️
Off to space

Yuri Dias Yuri-M-Dias

🛰️
Off to space
  • Brazil
View GitHub Profile
@ChevyRay
ChevyRay / qoi.rs
Created November 24, 2021 22:49
QOI - Quote OK Image Format (Rust Port)
const INDEX: u8 = 0x0;
const RUN_8: u8 = 0x40;
const RUN_16: u8 = 0x60;
const DIFF_8: u8 = 0x80;
const DIFF_16: u8 = 0xc0;
const DIFF_24: u8 = 0xe0;
const COLOR: u8 = 0xf0;
const MASK_2: u8 = 0xc0;
const MASK_3: u8 = 0xe0;
use std::error::Error;
use std::io::{stdin, Read};
use std::time;
fn main() -> Result<(), Box<dyn Error>> {
let mut v: Vec<u8> = vec![0; 65536];
let mut howmany = 0;
let s = stdin();
let mut cin = s.lock();
let mut n = 1;
@susimsek
susimsek / CustomExceptionControllerAdvice.java
Last active September 13, 2023 02:04
Spring Boot File Content Type Validation With Annotation
@ControllerAdvice
public class CustomExceptionControllerAdvice {
@ExceptionHandler(MultipartException.class)
void handleMultipartException(MultipartException ex,HttpServletResponse response) throws IOException {
response.sendError(HttpStatus.BAD_REQUEST.value(),"Please select a file");
}
@ExceptionHandler(ConstraintViolationException.class)
public void handleConstraintViolationException(ConstraintViolationException ex,HttpServletResponse response) throws IOException {
@darksidelemm
darksidelemm / 2020-11-14_FakeTLE_guide.md
Last active May 25, 2023 21:20
TLE Estimation for an Upcoming Rocket Launch

TLE Estimation for an Upcoming Rocket Launch

Scenario: RocketLab are launching 30 small-sats into space in a few days. We know that one of them is going to be transmitting on the amateur radio bands, but we haven't been able to obtain a pre-launch TLE yet. We want to get setup to use strf to listen for beacon signals (see my guide here), but we need to know when to expect the satellites. We have some basic orbital information from a press release, so how can we use this to estimate a TLE for prediction purposes?

Note: I am approaching this from the point-of-view of someone who really don't know much about orbital mechanics. I'm relying heavily on the experience of others, and the content below is my attempt at documenting the process taken.

Thanks to Cees Bassa for the amazing software as always...

@LukeMathWalker
LukeMathWalker / audit.yml
Last active June 27, 2024 21:15
GitHub Actions - Rust setup
name: Security audit
on:
schedule:
- cron: '0 0 * * *'
push:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
jobs:
security_audit:
@darksidelemm
darksidelemm / STRF_Setup.md
Last active December 2, 2023 02:27
Setting up STRF Capture & Processing

Setting up STRF Data Capture & Processing

Author: Mark Jessop (VK5QI) vk5qi@rfhead.net

This guide provides information on how to capture FFT data using the strf toolset, process it to look for satellite signals, and finally compare their doppler shift against TLEs from the SpaceTrack database. This can help with resolving the 'TLE lottery' after new launches, or cataloguing transmissions from spacecraft already in orbit.

It should be noted that the analysis described in this document is but a small subset of what the strf tools are capable of! Scott Tilley has a post describing some of the history behind strf and giving a crash course on the relationship between orbital dynamics and the doppler effect here: https://skyriddles.wordpress.com/2019/01/04/basic-orbital-dynamics/

The target platform is Debian-based distributions (e.g. Debian, Raspbian, Ubuntu), but should be applicable to other Linux-based platforms. The data processing software (rfplot and rffit) is also k

@zonca
zonca / map_data_to_healpix.ipynb
Last active January 2, 2024 01:32
Map data to HEALPix
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@StevenACoffman
StevenACoffman / Homoglyphs.md
Last active June 24, 2024 14:57
Unicode Look-alikes

Unicode Character Look-Alikes

Original Letter Look-Alike(s)
a а ạ ą ä à á ą
c с ƈ ċ
d ԁ ɗ
e е ẹ ė é è
g ġ
h һ
@samthor
samthor / css-modules-plugin.mjs
Last active August 2, 2022 14:01
CSS Modules plugin for Rollup
import fs from 'fs';
// as per https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/master/CSSModules/v1Explainer.md
export default function cssModules() {
return {
name: 'css-modules',
async load(id) {
if (!id.endsWith('.css')) {
return;
@mikeshardmind
mikeshardmind / dofus-setup-2.48.sh
Last active April 15, 2020 23:05
Because Ankama still can't actually properly package for linux. (Ubuntu 18.04 Bionic tested)
#!/bin/bash
# This is a shitty workaround to Ankama not providing everything required in an actual package
# or even a proper dependency list.
# License: Unlicense, see bottom of file
if [ $# -ne 2 ]; then
echo "Usage: $0 path/to/dofus.tar.gz path/to/place/game/folder"
exit 0