Skip to content

Instantly share code, notes, and snippets.

View darkfall's full-sized avatar

Robert Bu darkfall

View GitHub Profile
@bishboria
bishboria / springer-free-maths-books.md
Last active March 22, 2024 11:19
Springer made a bunch of books available for free, these were the direct links
@lichray
lichray / visit_at.cc
Last active January 15, 2023 10:45
Access tuple by runtime index (C++20)
#include <functional>
#include <stdexcept>
#include <tuple>
#include <type_traits>
template <int Low, int High, int Mid = (Low + High) / 2>
inline constexpr auto _visit_at = nullptr;
template <int Low, int High, int Mid>
requires(Low > High)
anonymous
anonymous / gist:de6b81c556b5dc7cdc8b
Created February 20, 2015 01:42
Kernel panic in latest OS X in 10 lines of C
#include <unistd.h>
#include <mach/mach.h>
#include <mach/mach_vm.h>
#include <mach-o/dyld.h>
int
main (int argc, char * argv[])
{
volatile char * library;
const mach_vm_size_t page_size = getpagesize ();
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active April 24, 2024 12:29
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);
@staltz
staltz / introrx.md
Last active April 24, 2024 18:10
The introduction to Reactive Programming you've been missing
@ffevotte
ffevotte / foo.cxx
Created January 6, 2014 14:50
Create a precompiled header with libclang
#include "foo.hxx"
int main () {
return 0;
}
@onlytiancai
onlytiancai / wawammseg.py
Created June 30, 2012 08:44
写了一个简单的支持中文的正向最大匹配的机械分词,其它不用解释了,就几十行代码
# -*- coding:utf-8 -*-
'写了一个简单的支持中文的正向最大匹配的机械分词,其它不用解释了,就几十行代码'
'搜狗词库下载地址:http://vdisk.weibo.com/s/7RlE5'
import string
__dict = {}
def load_dict(dict_file='words.dic'):
'加载词库,把词库加载成一个key为首字符,value为相关词的列表的字典'
@od0x0
od0x0 / gist:965399
Created May 10, 2011 21:17
How I Load a .ogg into OpenAL Using stb_vorbis
typedef struct{
ALuint ID;
stb_vorbis* stream;
stb_vorbis_info info;
ALuint buffers[2];
ALuint source;
ALenum format;