Skip to content

Instantly share code, notes, and snippets.

View Vicfred's full-sized avatar
:octocat:
I like mathemagic and computering

Vicfred Vicfred

:octocat:
I like mathemagic and computering
View GitHub Profile
@veekaybee
veekaybee / normcore-llm.md
Last active May 24, 2024 16:56
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@MiSawa
MiSawa / gen.cpp
Last active December 28, 2022 02:31
Exponential instance for a wrong implementation of Dinic
#include <iostream>
#include <vector>
#include <tuple>
#include <array>
// s u - u - u - u
// | > a < X X X > c - t
// b v - v - v - v
@fay59
fay59 / Quirks of C.md
Last active January 23, 2024 04:24
Quirks of C

Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.

There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.

1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]

struct foo {
   struct bar {
 int x;
@Chillee
Chillee / dinic.cpp
Last active July 14, 2022 02:10
Max Flow (Dinic's, HLPP)
template <int MAXV, class T = int> struct Dinic {
const static bool SCALING = false; // non-scaling = V^2E, Scaling=VElog(U) with higher constant
int lim = 1;
const T INF = numeric_limits<T>::max();
struct edge {
int to, rev;
T cap, flow;
};
int s = MAXV - 2, t = MAXV - 1;
@m93a
m93a / .XCompose
Last active December 9, 2023 06:15
Math symbols for the compose key
# Math
<Multi_key> <A> <A> : "∀"
<Multi_key> <E> <E> : "∃"
<Multi_key> <exclam> <E> <E> : "∄"
<Multi_key> <minus> <0> : "−"
<Multi_key> <KP_Subtract> <KP_0> : "−"
<Multi_key> <asterisk> <1> : "⋅"
<Multi_key> <KP_Multiply> <KP_1> : "⋅"
@kurlov
kurlov / mkv embed soft subtitles
Created December 16, 2017 23:41
ffmpeg command to add .srt based subtitles to an .mkv file
ffmpeg -i in.mkv -f srt -i in.srt -map 0:0 -map 0:1 -map 1:0 -c:v copy -c:a copy -c:s srt out.mkv
@ilyar
ilyar / ‎rsync_tutorial‎.md
Last active December 25, 2023 03:29
rsync tutorial‎

How rsync works

(source: https://sites.google.com/site/rsync2u/home/rsync-tutorial/how-rsync-works3)

~/demo1$rsync is efficient. The first time rsync is run, destination is created and the full source is copied to destination. Thereafter, only changes in source are copied to destination. If the --link-dest option is used, unchanged files are hard linked to the previous backup.

A hard link is a pointer to a file. Hard links have the advantage of using very little memory. There is an illustrated explanation of hard links on http://blog.interlinked.org/tutorials/rsync_time_machine.html > scroll down to “Hard-Links”.

Here is how the "rsync --link-dest=DIR" algorithm creates files in destination:

if destination does not exists,

@Brainiarc7
Brainiarc7 / ffmpeg-livestream-to-streaming-sites-vaapi-nvenc.md
Last active April 21, 2024 04:22
ffmpeg livestreaming to youtube via Nvidia's NVENC and Intel's VAAPI on supported hardware

Streaming your Linux desktop to Youtube and Twitch via Nvidia's NVENC and VAAPI:

Considerations to take when live streaming:

The following best practice observations apply when using a hardware-based encoder for live streaming to any platform:

  1. Set the buffer size (-bufsize:v) equal to the target bitrate (-b:v). You want to ensure that you're encoding in CBR mode.

  2. Set up the encoders as shown:

@protrolium
protrolium / ffmpeg.md
Last active May 15, 2024 18:27
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@daniel-j
daniel-j / wallpaper-changer
Last active July 26, 2022 08:07
This is a simple random wallpaper changer to use with Awesome WM. You need to install feh to use this.
#!/bin/bash
#
# Created by djazz // Dangershy
# Dependencies: feh
#
FOLDER="~/Pictures/wallpapers"
DELAY=10
# to make it loop over lines instead of spaces in filenames