Skip to content

Instantly share code, notes, and snippets.

View pendingchaos's full-sized avatar

PendingChaos pendingchaos

  • Earth
View GitHub Profile
@quchen
quchen / trolling_haskell
Last active February 24, 2024 01:30
Trolling #haskell
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF
| FUCKIN PUSSIES
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS
13:16 <luite> | hello
13:16 <ChongLi> | somebody has a mental illness!
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel
| compelled to write Node.js!
13:16 <genisage> | hi
13:16 <luite> | you might be pleased to learn that you can compile
| haskell to javascript now
@Gallefray
Gallefray / Evil assembly language
Last active August 29, 2015 13:57
Evil assembly language, courtesy of a talk I have had with antonijn
The general registers:
¹ ½ ¾
binary:
²
trinary:
³
push:
@pendingchaos
pendingchaos / README.md
Last active October 13, 2015 20:05
The most awesome arm printer.

Awesome Arms v1.0.0

Animation

Usage:

awesomearms <the number of lines of awesome arms>

Or:

@pendingchaos
pendingchaos / partialpartial.cpp
Created July 25, 2015 20:36
Partial partial function application.
#include <cstdio>
template <typename R, typename A1, typename... Args>
class _partialpartial
{
public:
typedef R R_type;
_partialpartial(R (*func_)(A1, Args...),
A1 arg1_) : func(func_), arg1(arg1_) {}
@pendingchaos
pendingchaos / README.md
Last active October 7, 2015 14:01
Translates a text a gazillion times then into English to produce awesomeness.

Example usage

cat <input file> | python2 gobbledygook.py > <output file>

Sample output

Rudolph, the Red-Nosed Reindeer
The nose is very strong.
If you do not see,
It should be great.

@pendingchaos
pendingchaos / matrix_mul.cpp
Last active October 23, 2019 21:10
SSE 4x4 matrix multiplication
#include <xmmintrin.h>
//~2.4x faster than non-SSE unrolled version.
//Uses row-major order (D3D or non-OpenGL layout).
void mul(float result[4][4], float a[4][4], float b[4][4])
{
__m128 otherRow0 = _mm_loadu_ps(b[0]);
__m128 otherRow1 = _mm_loadu_ps(b[1]);
__m128 otherRow2 = _mm_loadu_ps(b[2]);
__m128 otherRow3 = _mm_loadu_ps(b[3]);
@pendingchaos
pendingchaos / gtk3.supp
Last active January 29, 2016 15:19
A Valgrind suppression file for GTK+ applications. Just add --suppressions=/path/to/gtk3.supp.
{
<insert_a_suppression_name_here>
Memcheck:Leak
match-leak-kinds: possible
fun:calloc
fun:g_malloc0
obj:/usr/lib64/libgobject-2.0.so.0.4200.2
fun:g_type_register_fundamental
obj:/usr/lib64/libgobject-2.0.so.0.4200.2
obj:/usr/lib64/libgobject-2.0.so.0.4200.2
@pendingchaos
pendingchaos / style.css
Last active November 14, 2017 17:35
Opinionated Stylish Style for Twitter.
@-moz-document url("https://twitter.com/") {
body {
background-color: #131515;
background: #131515;
}
body:not(.edge-design) {
background-color: #131515 !important;
background: #131515 !important;
}
}
@pendingchaos
pendingchaos / aabb_tranform.c
Last active January 29, 2016 15:19
AABB transformation
//-O0: SSE is ~6.3x faster
//-O1: SSE is ~4.6x faster
//-O2: SSE is ~2.5x faster
//-O3: SSE is ~2.2x faster
//-Og: SSE is ~5.5x faster
//-Ofast: SSE is ~1.7x faster
//-Os: SSE is ~2.3x faster
//You probably should not trust these timings.
//Compiled with GCC 5.3.1
//Ran on a Intel(R) Core(TM) i7-3770K CPU
@pendingchaos
pendingchaos / README.md
Last active September 6, 2018 11:11
Base XScreensaver hack or screensaver

Installation

  • Copy base.xml to /usr/share/xscreensaver/config
  • Copy the compiled base.c (named "base") to /usr/libexec/xscreensaver
  • Add "GL: base -root\n" to programs in .xscreensaver in your home directory.