Skip to content

Instantly share code, notes, and snippets.

@CastIrony
CastIrony / watspec.txt
Created March 21, 2019 17:50
WAT Specification 1.0
WAT is a Brainfuck variant,
+ -> WAT
- -> WAAT
> -> WAAAT
< -> WAAAAT
. -> WAAAAAT
, -> WAAAAAAT
[ -> WAAAAAAAT
] -> WAAAAAAAAT
guard
!arguments.isEmpty,
nums.count = arguments.count
else
{
print("Usage: \(appName) <list-of-positive-integers>")
exit(-1)
}
//
// NSArray+JBDiff.h
// Tyche
//
// Created by Joel Bernstein on 9/16/09.
//
#import <Foundation/Foundation.h>
{
"response": {
"ack": true,
"sessions": [
{
"id": "6150",
"title": "Color Management Lab",
"track": "Graphics and Games",
"type": "Lab",
"room": "Graphics and Games Lab A",
varying highp vec2 textureCoordinate;
uniform sampler2D inputImageTexture;
#define M_PI 3.1415926535897932384626433832795
void main()
{
highp vec2 centered = textureCoordinate - vec2(0.5, 0.5);
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.viewController = [[JBViewController alloc] initWithNibName:@"JBViewController" bundle:nil];
self.window.rootViewController = self.viewController;
// ADD THIS LINE:
[self.window setTransform:CGAffineTransformMakeScale(0.81, 0.81)];
+(NSData*)dataForPOSTWithDictionary:(NSDictionary *)dictionary boundary:(NSString *)boundary
{
NSMutableData* postBodyData = [NSMutableData data];
for(NSString* key in dictionary)
{
id value = [dictionary valueForKey:key];
if([value isKindOfClass:[NSData class]])
{
@interface NSArray (BlockEnumerationTest)
-(void)enumerateObjectsUsingBlockType1:(void (^)(id, NSUInteger, BOOL *))block;
-(void)enumerateObjectsUsingBlockType2:(void (^)(id, NSUInteger, BOOL *))block;
@end
-(void)authenticateWithEmail:(NSString*)email password:(NSString*)password retries:(int)retries andThen:(BasicBlock)work
{
NSString* urlString = @"https://www.google.com/accounts/ClientLogin";
NSMutableDictionary* requestParameters = [NSMutableDictionary dictionary];
[requestParameters setObject:email forKey:@"Email"];
[requestParameters setObject:password forKey:@"Passwd"];
[NSURLConnection postToUrlString:urlString withParameters:requestParameters completionBlock:^(NSData* data, NSURLResponse* response, NSError* error)
#import "Common.h"
@interface AnimatedFloat : NSObject
@property (nonatomic, assign) GLfloat startValue;
@property (nonatomic, assign) NSTimeInterval startTime;
@property (nonatomic, assign) GLfloat endValue;
@property (nonatomic, assign) NSTimeInterval endTime;
@property (nonatomic, assign) AnimationCurve curve;