Skip to content

Instantly share code, notes, and snippets.

View sunsided's full-sized avatar
🇺🇦
#StandWithUkraine

Markus Mayer sunsided

🇺🇦
#StandWithUkraine
View GitHub Profile
@smhanov
smhanov / dawg.py
Last active May 11, 2025 00:53
Use a DAWG as a map
#!/usr/bin/python3
# By Steve Hanov, 2011. Released to the public domain.
# Please see http://stevehanov.ca/blog/index.php?id=115 for the accompanying article.
#
# Based on Daciuk, Jan, et al. "Incremental construction of minimal acyclic finite-state automata."
# Computational linguistics 26.1 (2000): 3-16.
#
# Updated 2014 to use DAWG as a mapping; see
# Kowaltowski, T.; CL. Lucchesi (1993), "Applications of finite automata representing large vocabularies",
# Software-Practice and Experience 1993
@r1pper
r1pper / FastLog
Last active October 31, 2023 15:34
Fast float Logarithm in C# using lookup Table
using System;
using System.Runtime.InteropServices;
namespace Test2
{
public static class FastLog
{
[StructLayout(LayoutKind.Explicit)]
private struct Ieee754
{
@davidfowl
davidfowl / dotnetlayout.md
Last active June 29, 2025 14:46
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@jakevdp
jakevdp / CategoricalCMAP.ipynb
Last active June 8, 2025 22:34
Example of a categorical color map in matplotlib
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wdullaer
wdullaer / install.sh
Last active April 3, 2025 19:08
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active June 26, 2025 20:36
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@richardkundl
richardkundl / BloomFilter.cs
Created January 7, 2014 14:29
Bloom filter implementation in c#.
namespace BloomFilter
{
using System;
using System.Collections;
/// <summary>
/// Bloom filter.
/// </summary>
/// <typeparam name="T">Item type </typeparam>
public class Filter<T>
@noctarius
noctarius / gist:7784770
Created December 4, 2013 09:29
Hazelcast MapReduce Avg Example
package com.hazelcast.mapred.test;
import com.hazelcast.core.CompletableFuture;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.IMap;
import com.hazelcast.mapred.*;
import java.util.List;
import java.util.Map;
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active March 21, 2025 15:01
Backend Architectures Keywords and References
@hideo55
hideo55 / FindSSE.cmake
Created May 24, 2013 11:35
CMake module that detect SSE support
# Check if SSE instructions are available on the machine where
# the project is compiled.
MACRO (FindSSE)
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
EXEC_PROGRAM(cat ARGS "/proc/cpuinfo" OUTPUT_VARIABLE CPUINFO)
STRING(REGEX REPLACE "^.*(sse2).*$" "¥¥1" SSE_THERE ${CPUINFO})
STRING(COMPARE EQUAL "sse2" "${SSE_THERE}" SSE2_TRUE)