Skip to content

Instantly share code, notes, and snippets.

@sphaero
sphaero / glesgeneric.c
Last active June 24, 2019 18:10
Gstreamer glimagesink raspberry pi generic example
/*
* GStreamer GLES2 Raspberry Pi example
* Based on http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/tests/examples/gl/generic/cube/main.cpp
* Modified for Raspberry Pi/GLES2 by Arnaud Loonstra <arnaud@sphaero.org>
* Orginal by Julien Isorce <julien.isorce@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
@kylemcdonald
kylemcdonald / Matlab.pde
Last active August 29, 2015 14:02
Lomb-Scargle periodogram for Processing, ported from Matlab code, so it's very idiosyncratic and non-idiomatic. Original code published in "Ice Ages and Astronomical Causes: Data, Spectral Analysis and Mechanisms" available at http://books.google.com/books?id=P8ideTkMQisC&pg=PA289&dq=spectral+lomb+scargle&hl=en
float[] hann(float[] x) {
int n = x.length;
float[] result = new float[n];
for(int i = 0; i < n; i++) {
float weight = .5 * (1 - cos((TWO_PI * i) / (n - 1)));
result[i] = x[i] * weight;
}
return result;
}
@paultreny
paultreny / tidy.conf
Created March 28, 2014 00:09
The config file I use for tidy-html5. $ tidy -config <path/to/tidy.conf> input.html > output.html
// paulcode.com
// tidy-html5 config file (mine's named "tidy.conf")
// tidy documentation is here: http://tidy.sourceforge.net/#docs
// tidy-html5 documentation here: http://w3c.github.io/tidy-html5/quickref.html#drop-empty-elements
join-classes: no
logical-emphasis: no
drop-empty-elements: no
anchor-as-name: no
doctype: auto
@ryangray
ryangray / buttondown.css
Created February 22, 2012 06:45
A clean, minimal CSS stylesheet for Markdown, Pandoc and MultiMarkdown HTML output.
/*
Buttondown
A Markdown/MultiMarkdown/Pandoc HTML output CSS stylesheet
Author: Ryan Gray
Date: 15 Feb 2011
Revised: 21 Feb 2012
General style is clean, with minimal re-definition of the defaults or
overrides of user font settings. The body text and header styles are
left alone except title, author and date classes are centered. A Pandoc TOC