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
๐Ÿ‘Ž ๐Ÿ‘Ž ๐Ÿ‘Ž
๐Ÿ‘ ๐Ÿ‘Ž ๐Ÿ‘Ž
๐Ÿ‘Ž ๐Ÿ‘ ๐Ÿ‘Ž
๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘