This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import email.mime.text | |
import email.header | |
import smtplib | |
email.Charset.add_charset('utf-8', email.Charset.QP, email.Charset.QP, 'utf-8') | |
me = u'Foo Bar <test@example.com>' | |
you = me |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Example for a mini web app that keeps its state in a custom class instance | |
import bottle | |
class Foo: | |
def main(self, value=0): | |
self.sum += value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# OS X-specific fix based on http://bugs.python.org/issue9033 | |
readline.parse_and_bind('bind {} rl_complete'.format('^I')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AppDelegate.h | |
// ThreadTest | |
// | |
// Created by Marc Liyanage on 9/23/12. | |
// | |
#import <Cocoa/Cocoa.h> | |
@interface AppDelegate : NSObject <NSApplicationDelegate> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[core] | |
excludesfile = /Users/liyanage/.gitignore.global | |
[log] | |
date = local | |
[user] | |
name = Marc Liyanage | |
email = foo@example.com | |
[github] | |
user = liyanage | |
token = xxxxx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CFLAGS='-std=c99 -arch x86_64' make cachetest && ./cachetest | |
#include <stdio.h> | |
#include <time.h> | |
void a(); | |
void b(); | |
int main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CFLAGS='-arch i386' make blockstest && ./blockstest | |
#include <stdio.h> | |
#include <Block.h> | |
int main() { | |
int(^foo)() = ^() { | |
return 1+1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// LDFLAGS='-framework Foundation' make test2 && ./test2 | |
#import <Foundation/Foundation.h> | |
@interface Foo : NSObject { | |
NSString *bar; | |
} | |
@property (retain) NSString *bar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// LDFLAGS='-framework Foundation' make archivertest | |
#import <Foundation/Foundation.h> | |
typedef enum Foo { | |
Foo1 = 0UL, | |
Foo2 = 1, | |
Foo3 = 2 | |
} FooType; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREFIX=/tmp/myframework | |
mkdir -p $PREFIX/{old,new} | |
rm -f $PREFIX/{old,new}/* | |
cat > myframework.c <<EOF | |
int foo() { | |
return 123; | |
} | |
EOF |