Skip to content

Instantly share code, notes, and snippets.

@stephanecopin
stephanecopin / NSURLRequest+CURLRequest.h
Created March 11, 2016 20:21
NSURLRequest+CURLRequest
#import <Foundation/Foundation.h>
@interface NSURLRequest (CURLRequest)
@property (nonatomic, copy, readonly) NSString * CURLRequest;
@end
@stephanecopin
stephanecopin / swiftlint_modified.sh
Last active January 12, 2021 20:16
Run SwiftLint only on untracked/modified (staged or not)/added swift files from git
if which swiftlint >/dev/null; then
count=0
for file_path in $(git ls-files -om --exclude-from=.gitignore | grep ".swift$"); do
export SCRIPT_INPUT_FILE_$count=$file_path
count=$((count + 1))
done
for file_path in $(git diff --cached --name-only | grep ".swift$"); do
export SCRIPT_INPUT_FILE_$count=$file_path
count=$((count + 1))
done