Skip to content

Instantly share code, notes, and snippets.

View matthewbauer's full-sized avatar

Matthew Bauer matthewbauer

View GitHub Profile
@gnachman
gnachman / .emacs
Created June 26, 2020 07:05
Make CSI u mode work in emacs
(unless (display-graphic-p)
(add-hook 'after-make-frame-functions
'(lambda
;; Take advantage of iterm2's CSI u support (https://gitlab.com/gnachman/iterm2/-/issues/8382).
(xterm--init-modify-other-keys)
;; Courtesy https://emacs.stackexchange.com/a/13957, modified per
;; https://gitlab.com/gnachman/iterm2/-/issues/8382#note_365264207
(defun character-apply-modifiers (c &rest modifiers)
"Apply modifiers to the character C.
@a1k0n
a1k0n / ylogo.c
Created October 22, 2015 01:02
Expanded version of the code featured in http://www.a1k0n.net/2011/06/26/obfuscated-c-yahoo-logo.html
#include <math.h>
#include <stdio.h>
#include <unistd.h>
// Each character encodes an angle of a plane we are checking
const char plane_angles[] = "O:85!fI,wfO8!yZfO8!f*hXK3&fO;:O;#hP;\"i[";
// and these encode an offset from the origin s.t. (x, y) dot (cos(a), sin(a)) < offset
const char plane_offsets[] = "<[\\]O=IKNAL;KNRbF8EbGEROQ@BSXXtG!#t3!^";
// this table encodes the offsets within the above tables of each polygon
@paulirish
paulirish / bling.js
Last active April 20, 2024 17:39
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@imjasonh
imjasonh / markdown.css
Last active February 12, 2024 17:18
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@bellbind
bellbind / getscreenshot.c
Created July 1, 2009 13:33
[c][gtk][webkit]get screenshot PNG from web page
/*
* get screenshot PNG from web page
*
* build:
* FLAGS=`pkg-config --cflags --libs gtk+-x11-2.0 glib-2.0 webkit-1.0`
* gcc -Wall $FLAGS getscreenshot.c -o getscreenshot
*
* usage:
* /usr/bin/xvfb-run -s "-screen 0 1024x768x24" ./getscreenshot test.html
*