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 / 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;
((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 / 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__; }
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,
__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);
@robrix
robrix / gist:7831048
Created December 6, 2013 19:48
herpderpicons
⚆︗⨀
⚆‿⨀
⚆␣⨀
⚆˾⨀
⚆⫎⨀
⚆⩌⨀