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
// hook.io handling Stripe | |
var stripe = require('stripe'); | |
var url = require('url'); | |
var querystring = require('querystring'); | |
module.exports = function (hook) { | |
var req = hook.req; | |
var res = hook.res; |
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
#import <Foundation/Foundation.h> | |
@interface Each <Object> : NSObject | |
@property (nonatomic, strong) NSArray <Object> *array; | |
- (instancetype)initWithArray:(NSArray <Object> *)array; | |
@end |
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
// The MIT License (MIT) | |
// | |
// Copyright (c) 2015 James Tang ([email protected]) | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
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
// usage: @keypath(arg) | |
// like how you use @selector(arg) | |
// For a full implementation, checkout https://github.com/jspahrsummers/libextobjc | |
#define keypath(PATH) \ | |
(((\ | |
NSStringFromSelector(@selector(PATH))\ | |
), # PATH)) |
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
NSString *version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; | |
[[NSUserDefaults standardUserDefaults] setObject:version | |
forKey:@"version_preference"]; | |
NSString *build = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]; | |
[[NSUserDefaults standardUserDefaults] setObject:build | |
forKey:@"build_preference"]; | |
NSString *githash = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"GITHash"]; | |
[[NSUserDefaults standardUserDefaults] setObject:githash |
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
// | |
// Created by James Tang @jamztang | |
// https://gist.github.com/jamztang/68c3e16d071a01db81cf | |
// | |
// Credit goes to https://stackoverflow.com/questions/25753373/ios-8-gm-does-not-update-constraints-on-collection-views/25768375#25768375 | |
// | |
import UIKit | |
class BaseCollectionViewCell: UICollectionViewCell { |
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
#import <UIKit/UIKit.h> | |
#import "CSAnimation.h" | |
#import "CSAnimationView.h" | |
@interface CSLoopingAnimationView : CSAnimationView | |
@end |
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
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
self.videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionFront]; | |
self.videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait; | |
// self.avatarView is a non full screen GPUImageView instance | |
// created in Storyboard | |
[self.videoCamera addTarget:self.avatarView]; | |
[self.videoCamera startCameraCapture]; |
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
Copyright (c) 2013 Jamz Tang <[email protected]> | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is furnished | |
to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all |
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
Copyright (c) 2013 Jamz Tang <[email protected]> | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is furnished | |
to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all |
NewerOlder