Skip to content

Instantly share code, notes, and snippets.

@wareya
wareya / spi_recorder.ino
Last active April 24, 2024 20:52
long SPI message recorder - rasberry pi pico (rp2040), arduino IDE .ino file (C++)
// wiring example for ripping a PMW3360 SROM: https://i.imgur.com/EspAlvz.jpeg
// set the board to 240mhz or higher for best results (WARNING: higher than 240mhz only works with USB if you overvolt the MCU)
// this implements reading SPI mode 3. if you want a different mode, you need to edit these two lines:
// uint32_t clockval = (1 << pin_clock);
// if (newclock && !clockval && buff_i < buffsize)
#include <pico/stdlib.h>
#define buffsize 50000

Touchscreen not working in custom recovery on Mediatek devices - MTK - mtxxxx

This is not a complete guide. But a start for future discussions.

A little information

As far as we know, companies may or may not include touchscreen drivers in the kernel. In such situations, experts analyze the kernel and modify it to include the correct driver and try to make the touch screen work. If you've seen the situation happen and you don't have extra touchscreen driver files, go to the links to learn about it or ask for help:

How to modify a (Meditek) Android kernel - github thanks for @ADeadTrousers

@gvolpe
gvolpe / di-in-fp.md
Last active April 24, 2024 20:51
Dependency Injection in Functional Programming

Dependency Injection in Functional Programming

There exist several DI frameworks / libraries in the Scala ecosystem. But the more functional code you write the more you'll realize there's no need to use any of them.

A few of the most claimed benefits are the following:

  • Dependency Injection.
  • Life cycle management.
  • Dependency graph rewriting.
@kylophone
kylophone / loudness.rb
Last active April 24, 2024 20:50
FFmpeg loudnorm filter - dual pass loudness normalization example - http://k.ylo.ph/2016/04/04/loudnorm.html
#!/usr/bin/env ruby
require 'open3'
require 'json'
ffmpeg_bin = '/usr/local/bin/ffmpeg'
target_il = -24.0
target_lra = +11.0
target_tp = -2.0
samplerate = '48k'
@eneko
eneko / list-of-curl-options.txt
Last active April 24, 2024 20:48
List of `curl` options
$ curl --help
Usage: curl [options...] <url>
--abstract-unix-socket <path> Connect via abstract Unix domain socket
--alt-svc <file name> Enable alt-svc with this cache file
--anyauth Pick any authentication method
-a, --append Append to target file when uploading
--basic Use HTTP Basic Authentication
--cacert <file> CA certificate to verify peer against
--capath <dir> CA directory to verify peer against
-E, --cert <certificate[:password]> Client certificate file and password
@HexedHero
HexedHero / mc_client_performance_guide.md
Last active April 24, 2024 20:47
Performance guide for Minecraft 1.20.4+ Clients

Performance guide for Minecraft 1.20.4+ Clients

📜 Fabric

Fabric is the "modern" Minecraft modding software that is very modular.
We use Fabric in this guide so install it by going to https://fabricmc.net/use/ Download the .jar or .exe and run it.

Below is a list of performance and utility mods to make your Minecraft experience better and most importantly smooth.
The list is in order of most importance and they all work together including what they do with why to use them.

@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 24, 2024 20:47
Complete Recent Discord Quest

Complete Recent Discord Quest

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
  2. Join a vc
  3. Stream any window (can be notepad or something)
  4. Press Ctrl+Shift+I to open DevTools
  5. Go to the Console tab
  6. Paste the following code and hit enter:
let wpRequire;
@Khankindle
Khankindle / dinobot_oneshot_il.py
Created April 24, 2024 20:42 — forked from normandipalo/dinobot_oneshot_il.py
Code snippet for the one-shot imitation learning phase of DINOBot (alignment + replay).
"""
In this script, we demonstrate how to use DINOBot to do one-shot imitation learning.
You first need to install the following repo and its requirements: https://github.com/ShirAmir/dino-vit-features.
You can then run this file inside that repo.
There are a few setup-dependent functions you need to implement, like getting an RGBD observation from the camera
or moving the robot, that you will find on top of this file.
"""
import torch
import numpy as np
@normandipalo
normandipalo / dinobot_oneshot_il.py
Last active April 24, 2024 20:42
Code snippet for the one-shot imitation learning phase of DINOBot (alignment + replay).
"""
In this script, we demonstrate how to use DINOBot to do one-shot imitation learning.
You first need to install the following repo and its requirements: https://github.com/ShirAmir/dino-vit-features.
You can then run this file inside that repo.
There are a few setup-dependent functions you need to implement, like getting an RGBD observation from the camera
or moving the robot, that you will find on top of this file.
"""
import torch
import numpy as np
@yasirkula
yasirkula / BatchExtractMaterials.cs
Last active April 24, 2024 20:41
Batch extract materials from 3D model assets in Unity
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.IO;
public class BatchExtractMaterials : EditorWindow
{
private enum ExtractMode { Extract = 0, Remap = 1, Ignore = 2 };
[System.Serializable]