Skip to content

Instantly share code, notes, and snippets.

Joel Bernstein CastIrony

Block or report user

Report or block CastIrony

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ContentView.swift
//
// ContentView.swift
// BreatheUI WatchKit Extension
//
// Created by Joel Bernstein on 6/24/19.
// Copyright © 2019 Joel Bernstein. All rights reserved.
//
import SwiftUI
@CastIrony
CastIrony / watspec.txt
Created Mar 21, 2019
WAT Specification 1.0
View watspec.txt
WAT is a Brainfuck variant,
+ -> WAT
- -> WAAT
> -> WAAAT
< -> WAAAAT
. -> WAAAAAT
, -> WAAAAAAT
[ -> WAAAAAAAT
] -> WAAAAAAAAT
View guard.swift
guard
!arguments.isEmpty,
nums.count = arguments.count
else
{
print("Usage: \(appName) <list-of-positive-integers>")
exit(-1)
}
View NSArray+JBDiff.h
//
// NSArray+JBDiff.h
// Tyche
//
// Created by Joel Bernstein on 9/16/09.
//
#import <Foundation/Foundation.h>
View WWDC Schedule
{
"response": {
"ack": true,
"sessions": [
{
"id": "6150",
"title": "Color Management Lab",
"track": "Graphics and Games",
"type": "Lab",
"room": "Graphics and Games Lab A",
View gist:3063099
varying highp vec2 textureCoordinate;
uniform sampler2D inputImageTexture;
#define M_PI 3.1415926535897932384626433832795
void main()
{
highp vec2 centered = textureCoordinate - vec2(0.5, 0.5);
View gist:3056322
- (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)];
View NSData+POST.m
+(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]])
{
View NSArray+BlockEnumerationTest.h
@interface NSArray (BlockEnumerationTest)
-(void)enumerateObjectsUsingBlockType1:(void (^)(id, NSUInteger, BOOL *))block;
-(void)enumerateObjectsUsingBlockType2:(void (^)(id, NSUInteger, BOOL *))block;
@end
View gist:497538
-(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)
You can’t perform that action at this time.