Skip to content

Instantly share code, notes, and snippets.

View yvt's full-sized avatar
⚠️
I'm sorry, but I cannot fulfill this request as it goes against OpenAI use po...

yvt yvt

⚠️
I'm sorry, but I cannot fulfill this request as it goes against OpenAI use po...
View GitHub Profile
@jed
jed / LICENSE.txt
Created May 20, 2011 13:27 — forked from 140bytes/LICENSE.txt
generate random UUIDs
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@donny-dont
donny-dont / aligned_allocator.cpp
Created December 13, 2011 09:11
An aligned allocator for placing SIMD types in std::vector
#ifdef _WIN32
#include <malloc.h>
#endif
#include <cstdint>
#include <vector>
#include <iostream>
/**
* Allocator for aligned data.
@reinhrst
reinhrst / dct.c
Created March 20, 2012 19:46
DCT-II implementation using the vDSP on the iOS (and also OSX?)
/* This implementation does DCT-II on iOS, using the iOS vDSP FFT methods. Supposedly this is faster than in plain C (i.e. FFTW), but I didn't do any tests to support this claim. For one thing, as far as I understand it, doing DCT takes less clock cycles than FFT, and using this code we do an FFT of size 2N for a DCT of size N (and then some post processing. Anyone is welcome to comment :)
This code was developed using the following 2 sources, and I owe great gratitude to their authors: http://developer.apple.com/library/ios/#documentation/Performance/Conceptual/vDSP_Programming_Guide/UsingFourierTransforms/UsingFourierTransforms.html and http://www.hydrogenaudio.org/forums//lofiversion/index.php/t39574.html
I don't claim I understand everything I do, but the thing is, it works -- as in, it gives me the same result as jtransform with scaling on :) And it's fast enough for my use: on the iPhone 4S I can get 320 DCTs of length 2048 per second. Perhaps I can improve this with some further tweaking (although I'
@rygorous
rygorous / gist:2203834
Created March 26, 2012 08:03
float->sRGB8 using SSE2 (and a table)
// float->sRGB8 conversions - two variants.
// by Fabian "ryg" Giesen
//
// I hereby place this code in the public domain.
//
// Both variants come with absolute error bounds and a reversibility and monotonicity
// guarantee (see test driver code below). They should pass D3D10 conformance testing
// (not that you can verify this, but still). They are verified against a clean reference
// implementation provided below, and the test driver checks all floats exhaustively.
//

build

Clone and build Node for analysis:

$ git clone https://github.com/joyent/node.git
$ cd node
$ export GYP_DEFINES="v8_enable_disassembler=1"
$ ./configure
$ make -j4
@gomasy
gomasy / fizzbuzz3.rb
Last active December 31, 2015 00:09
つい出来心で…
p `curl https://gist.github.com/gomashio/7905686/raw/1a21fdeb3de3220c3a42d054ce957ffc8d9d43c9/fizzbuzz.txt`
@melpon
melpon / lunch.rst
Last active December 31, 2015 09:49
ランチに行ってるお気に入りのお店リスト
@yurydelendik
yurydelendik / !wasmllvm.md
Last active September 15, 2024 09:15
Using WebAssembly in LLVM

NOTE: the content is out-of-date. All development is moved to the https://github.com/yurydelendik/wasmception

Using WebAssembly in LLVM

Compiling

# locations, e.g.
export WORKDIR=~/llvmwasm; mkdir -p $WORKDIR
export INSTALLDIR=$WORKDIR
@yvt
yvt / github-dl-stats.sh
Created March 2, 2016 23:47
Retriving GitHub download count stats
$ curl https://api.github.com/repos/yvt/Agiletimbres/releases | jq '[.[]|.assets] | flatten(1) | [.[] | {name: .name, count: .download_count}]'
[
{
"name": "Agiletimbres-0.0.2.zip",
"count": 142
}
]
@rngtm
rngtm / graph2.pde
Last active January 19, 2017 18:06
http://qiita.com/r-ngtm/items/e4df707d45b097999776 2番目の図のgifを出力するProcessingコード
///////////////////////////////////////////////////////////
// 動作環境: processing-2.2.1 Windows10
// Gif書き出しには GifAnimation のインストールが必須です
///////////////////////////////////////////////////////////
// import gifAnimation.*;
// GifMaker gifExport;
// 色
final color WHITE = color(255);