Skip to content

Instantly share code, notes, and snippets.

Avatar

Robert Bu darkfall

View GitHub Profile
@bishboria
bishboria / springer-free-maths-books.md
Last active Dec 18, 2020
Springer made a bunch of books available for free, these were the direct links
@lichray
lichray / visit_at.cc
Last active Sep 11, 2015
Access tuple by runtime index
View visit_at.cc
#include <tuple>
#include <type_traits>
template <int Low, int High, int Mid = (Low + High) / 2, typename = void>
struct _visit_at;
template <int Low, int High, int Mid>
struct _visit_at<Low, High, Mid, std::enable_if_t<(Low > High)>>
{
template <typename... T>
anonymous
anonymous / gist:de6b81c556b5dc7cdc8b
Created Feb 20, 2015
Kernel panic in latest OS X in 10 lines of C
View gist:de6b81c556b5dc7cdc8b
#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 ();
View GLSL-Noise.md

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);
	return mix(rand(fl), rand(fl + 1.0), fc);
}
@staltz
staltz / introrx.md
Last active Jan 19, 2021
The introduction to Reactive Programming you've been missing
View introrx.md
@ffevotte
ffevotte / foo.cxx
Created Jan 6, 2014
Create a precompiled header with libclang
View foo.cxx
#include "foo.hxx"
int main () {
return 0;
}
@onlytiancai
onlytiancai / wawammseg.py
Created Jun 30, 2012
写了一个简单的支持中文的正向最大匹配的机械分词,其它不用解释了,就几十行代码
View wawammseg.py
# -*- coding:utf-8 -*-
'写了一个简单的支持中文的正向最大匹配的机械分词,其它不用解释了,就几十行代码'
'搜狗词库下载地址:http://vdisk.weibo.com/s/7RlE5'
import string
__dict = {}
def load_dict(dict_file='words.dic'):
'加载词库,把词库加载成一个key为首字符,value为相关词的列表的字典'
@Oddity0x0
Oddity0x0 / gist:965399
Created May 10, 2011
How I Load a .ogg into OpenAL Using stb_vorbis
View gist:965399
typedef struct{
ALuint ID;
stb_vorbis* stream;
stb_vorbis_info info;
ALuint buffers[2];
ALuint source;
ALenum format;
You can’t perform that action at this time.