View chalk_nanocolors_transform.js
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
module.exports = function(fileInfo, api, options) { | |
const j = api.jscodeshift | |
const root = j(fileInfo.source) | |
var usedMethods = new Set() | |
const chalkImport = root.find(j.ImportDeclaration, { | |
source: { |
View gist:ef15d46434c0e083fff53653cba55210
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
pcm.!default { | |
type plug | |
slave.pcm { | |
type dmix | |
ipc_key 1024 | |
slave { | |
pcm "plughw:0,0" | |
rate 48000 # this line is only needed for USB DACs which only support 48khz | |
period_time 0 | |
period_size 1920 |
View NSStringHack.m
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
@interface NSString (ss) | |
- (NSString *):(NSString *)str; | |
@end | |
@implementation NSString (ss) | |
- (NSString *):(NSString *)str { | |
return [NSString stringWithFormat:self, str]; | |
} | |
@end |
View Enums.swift
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
enum EndPoints { | |
case GetUser | |
case UpdateUser(userData: User) | |
} | |
extension ParseEndpoints: HTTPEndPointConvertible, HTTPEndPointDSL { | |
func toHTTPEndPoint() -> HTTPEndPoint { | |
let baseURL = "https://api.parse.com/1" | |
switch (self) { |
View gist:10488144
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 (^)())@[ | |
^{[self action2];}, | |
^{[self action1];} ][value.boolValue])(); | |
//vs | |
if (value.booldValue) { | |
[self action1]; | |
} |
View gist:8961770
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
NSInteger sourceIntValue; | |
id mappedValue = (@{@(kSomeConstValue1): KSomeConstMappedValue1, | |
@(kSomeConstValue2): KSomeConstMappedValue2}[@(sourceIntValue)])?:KSomeConstMappedDefaultValue; | |
//VS | |
id mappedValue; | |
switch(sourceIntValue) { | |
case kSomeConstValue1: |
View gist:5785069
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
@interface UIScrollView (willBeginScrollingAnimation) | |
@end | |
@implementation UIScrollView (willBeginScrollingAnimation) | |
#pragma clang diagnostic push | |
#pragma clang diagnostic ignored "-Wobjc-method-access" | |
+(void)load { | |
Method setContentOffsetAnimatedMethod = class_getInstanceMethod([UIScrollView class], @selector(setContentOffset:animated:)); | |
IMP oldImplementation = method_getImplementation(setContentOffsetAnimatedMethod); |
View gist:5054182
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
source ~/.bash_profile | |
hash oclint &> /dev/null | |
if [ $? -eq 1 ]; then | |
echo >&2 "oclint not found, analyzing stopped" | |
exit 1 | |
fi |
View NSArray+first.h
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
@interface NSArray (addition) | |
-(id) firstObject; | |
@end |