Skip to content

Instantly share code, notes, and snippets.

#include "freeverb.h"
#define undenormalize(n) { if (xabs(n) < 1e-37) { (n) = 0; } }
static inline float xabs(float n) {
return n < 0 ? -n : n;
}
@benob
benob / stbttf.h
Last active October 7, 2024 09:47
Example for using stb_truetype with SDL2 renderer. Only supports ASCII characters.
#ifndef __STBTTF_H__
#define __STBTTF_H__
#include <SDL2/SDL.h>
#include "stb_rect_pack.h"
#include "stb_truetype.h"
/* STBTTF: A quick and dirty SDL2 text renderer based on stb_truetype and stdb_rect_pack.
* Benoit Favre 2019
@mashingan
mashingan / crud_web.nim
Last active June 11, 2023 00:45
Simplistic crud example using Jester and Nim
# This example using
# Nim: 0.18.0
# Jester: 0.2.1
# Using Jester >= 0.3.0 is preferrable if your Nim version > 0.18.0
# In case you're using Jester >= 0.3.0, look the syntax different
# in its example because it's not backward compatible
import db_sqlite, asyncdispatch, json, strformat, strutils, sequtils
import jester
@unitycoder
unitycoder / 0-win10-live-stream-server.txt
Last active April 16, 2022 11:26
Setting up Live Video Stream Server on Windows 10 (RTPM + HLS + OBS)
from http://zqdevres.qiniucdn.com/data/20170907091103/index.html
- download ngingx with RTPM module http://nginx-win.ecsds.eu/download/ *nginx 1.7.12.1 Lizard.zip
- unzip
- create start.bat script
@echo off
title Start Stream
cd /d "C:\nginx"
start nginx
exit
@sanchezzzhak
sanchezzzhak / clickhouse-get-tables-size.sql
Created January 18, 2018 13:43
clickhouse get tables size
SELECT table,
formatReadableSize(sum(bytes)) as size,
min(min_date) as min_date,
max(max_date) as max_date
FROM system.parts
WHERE active
GROUP BY table
@Tetralux
Tetralux / odin.bat
Last active June 11, 2023 15:56
A helper for compiling code with Odin on Windows
@ECHO OFF
:: Path to Odin executable
SET ODINPATH="C:\odin\odin.exe"
:: Path to the Microsoft 'vcvarsall.bat' file.
:: This sets the required environment vars and makes cl.exe and link.exe available in PATH.
SET VCVARSPATH="C:\Program Files (x86)\Microsoft Visual Studio\VC\Auxiliary\Build\vcvarsall.bat"
:: Only run the MSVC batch file the first time we
@zacharycarter
zacharycarter / wclwn.md
Last active August 19, 2024 03:44
Binding to C Libraries with Nim
@Abdenasser
Abdenasser / Admob.uno
Created February 20, 2017 13:36
Admob interstitial ads for Fuse
using Fuse;
using Fuse.Scripting;
using Fuse.Reactive;
using Uno.UX;
[UXGlobalModule]
public class Admob : NativeModule
{
static readonly Admob _instance;
public Android.InterstitialAdPage ad;
@jfstenuit
jfstenuit / Installing_linux_on_Baytrail_tablet.md
Last active December 12, 2024 10:44
Installing Linux on a Baytrail tablet

Hardware specs

Chinese Brand "ITworks" , Model TW891, distributed in France and Belgium by Darty

  • CPU: Intel(R) Atom(TM) CPU Z3735F @ 1.33GHz
  • Video: Intel® HD Graphics for Intel Atom® Processor Z3700 Series
  • Screen: 1280x800
  • WiFi + BT: Realtek RTL8723BS_BT
  • Disks: mmcblk1: mmc1:0001 DF4032 29.1 GiB
  • RAM: 2GB DDR3 @ 1333 MHz
@kkkrackpot
kkkrackpot / 3dl2-specification.txt
Created November 29, 2016 11:31
3dlut file specification
________________________________________________________________________________
3DL2 file format specification
http://forum.doom9.org/showthread.php?p=1525672#post1525672
________________________________________________________________________________
enum {PAGE_SIZE = 16384};
struct H3DLUT2
{