Skip to content

Instantly share code, notes, and snippets.

@neingeist
neingeist / mandelbrot-openmp.c
Last active August 29, 2015 14:01
just some OpenMP example
#include "SDL.h"
#include <complex.h>
#include <stdbool.h>
/* The maximum iteration count. */
const int max_it = 170;
/* Compute the out-coloring based on the iteration counter. */
Uint32 outcolor(int it) {
return 0x00010001 * ((it * 0xff) / max_it);
@neingeist
neingeist / keybase.md
Created August 4, 2014 19:16
keybase.md

Keybase proof

I hereby claim:

  • I am neingeist on github.
  • I am neingeist (https://keybase.io/neingeist) on keybase.
  • I have a public key whose fingerprint is CB77 0FCD B4AA 5FB0 108F 82B4 DB21 F68B 4A5D BB9F

To claim this, I am signing this object:

@neingeist
neingeist / gist:3bae8d937af603492717
Created September 25, 2014 20:03
MATLAB needs eth0 for its licensing system. So create one. (for Fedora 20 etc.)
# MATLAB needs eth0 for its licensing system. So create one:
ip link add eth0 type dummy
ip link set dev eth0 address 00:12:34:56:78:90:xy
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
\begin{equation} \label{eq:dft_1dconsymmetry}
\begin{aligned}
X_{-k} &\stackrel{\hphantom{x_n \in \mathbb{R}}}{=} \sum_{n=0}^{N-1}x_n\cdot e^{-i2\pi n -k/N} \\
&\stackrel{\hphantom{x_n \in \mathbb{R}}}{=} \sum_{n=0}^{N-1}x_n\cdot e^{+i2\pi n k/N} \\
&\stackrel{x_n \in \mathbb{R}}{=} X^*_k
\end{aligned}
\end{equation}
@neingeist
neingeist / gist:86d24ff38f7971f6dafc
Created March 15, 2015 13:05
a decorater example
from __future__ import division, print_function
from functools import wraps
import time
def timed(f):
"""Return a timed version of function f.
The returned function returns a tuple of (time, real return value)
@neingeist
neingeist / gist:1619725
Created January 16, 2012 08:20
maildrop .mailfilter recipe to add task to taskwarrior via email
#----------------------------------------------------------------------
# add a task to taskwarrior
#----------------------------------------------------------------------
if (/^From:.*VALIDSENDER@EXAMPLE.COM/ && /^To:.*taskwarrior@/)
{
# save a copy
cc "$MAILDIR/.task/"
# extract subject and add task
@neingeist
neingeist / wiki-upload.pl
Created June 30, 2012 17:28
Upload a file to a recent MediaWiki using the API
#!/usr/bin/perl
# Upload a file to a recent MediaWiki using the API.
use strict;
use MediaWiki::API 0.39;
my $wikiuser = $ARGV[0];
my $wikipass = $ARGV[1];
my $file = $ARGV[2];
my $comment = $ARGV[3];
@neingeist
neingeist / spcrc-logcat
Created November 3, 2012 14:15
Simple supercat configuration for Android logcat
# HTML COLOR NAME COL A N T STRING or REGULAR EXPRESSION
#################### ### # # # ################################################################
Red red (^E/.*)
Yellow yel (^W/.*)
@neingeist
neingeist / daumen.css
Created November 4, 2015 11:44
stylisher twitterdaumen
@-moz-document domain(twitter.com) {
.HeartAnimationContainer {
visibility: hidden;
}
.HeartAnimationContainer:after {
content: '👍';
visibility: visible;
display: block;
position: absolute;