Skip to content

Instantly share code, notes, and snippets.

View robrix's full-sized avatar
🌊
every dot and stroke I paint will be alive

Rob Rix robrix

🌊
every dot and stroke I paint will be alive
View GitHub Profile
@robrix
robrix / gist:7831048
Created December 6, 2013 19:48
herpderpicons
⚆︗⨀
⚆‿⨀
⚆␣⨀
⚆˾⨀
⚆⫎⨀
⚆⩌⨀
__attribute__((format_arg(__NSString__, 2)))
NSString *ಠ_ಠ_message(const char *severity, const char *format) {
return [NSString stringWithFormat:@"%s: %s", severity, format];
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-nonliteral"
__attribute__((format(printf, 1, 2)))
void ಠ_ಠ_warning(const char *format, ...) {
va_list ಠ_ಠ;
va_start(ಠ_ಠ, format);
My life's yours, love
That's why you'll find, somebody's on my mind
Wants the world to know
And my hair ain't curled
But youre so mean to me, baby, I know youre gonna drive me away
Some call me honey
Like an old sweet song, 'The Lasting Time'
Some tell me "Billie,
@robrix
robrix / autotes.m
Created March 31, 2014 02:51
Not quite as good as I’d hoped, but you can do some fun things with __typeof__.
// cc autotes.m -o autotes -framework Foundation -fobjc-arc && ./autotes
#import <Foundation/Foundation.h>
// use it like lambda(…args…)(…return value…)
#define lambda(...) \
^(__VA_ARGS__) _lambda_body
#define _lambda_body(...) \
{ return __VA_ARGS__; }
((w ord))
((w) (ord))
((word))
((wo rd))
((w o rd))
((w o r d))
((w o r) (d))
((w o) (rd))
((w o) (r d))
((wo) (rd))
@robrix
robrix / sliding-goes-to.c
Last active August 29, 2015 14:00
The sliding goes-to operator in C
#include <stdio.h>
int main(int argc, char *argv[]) {
int i = 10;
while (i \
\
\
\
--> 0) { printf("%i\n", i); }
return EXIT_SUCCESS;
@robrix
robrix / δ.md
Last active August 29, 2015 14:03
Convergence of nullability in the derivative of parser combinators

Interpreting δ as the least fixed point of the nullability equations, ascending from ⊥ = false.

Given S → ϵ ∪ S,

The zeroth iteration is :

δ⁰(S) = ⊥ = false

The first is computed:

@robrix
robrix / parseNull.md
Last active August 29, 2015 14:03
Convergence of parseNull in the derivative of parser combinators

Interpreting parseNull as the least fixed point of the parse null equations, ascending from ⊥ = {}

Given S → ϵ↓{x} ∪ S,

The zeroth iteration is :

parseNull⁰(S) = ⊥ = {}

The first is computed:

@robrix
robrix / &&-truth-table.md
Created February 17, 2015 02:59
The truth table for logical conjunction (&&)
a b a && b
👎 👎 👎
👍 👎 👎
👎 👍 👎
👍 👍 👍
@robrix
robrix / 1.md
Last active August 29, 2015 14:15
The sum is more than the hole of its parts
a b a && b
👎 👎 👎
👍 👎 👎
👎 👍 👎
👍 👍 👍