Skip to content

Instantly share code, notes, and snippets.

View paweldudek's full-sized avatar
Drinking coffee. Lots of it.

Pawel Dudek paweldudek

Drinking coffee. Lots of it.
View GitHub Profile
-(UIButton *)specsFindButtonInSubviewsWithTitle:(NSString *)title {
NSPredicate *buttonPredicate = [NSPredicate predicateWithBlock:^BOOL(UIView *view, NSDictionary *bindings) {
return [view isKindOfClass:[UIButton class]] && [[view accessibilityLabel] isEqualToString:title];
}];
return [[self.subviews filteredArrayUsingPredicate:buttonPredicate] firstObject];
}
@paweldudek
paweldudek / gist:ec69177479dfc15fcab5
Created June 26, 2014 09:01
UICollectionView Layout
@interface TAPCarouselCollectionViewLayout : UICollectionViewFlowLayout
@end
@implementation TAPCarouselCollectionViewLayout
#pragma mark - Invalidating Layout
- (BOOL)shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds {
### Keybase proof
I hereby claim:
* I am paweldudek on github.
* I am paweldudek (https://keybase.io/paweldudek) on keybase.
* I have a public key whose fingerprint is B961 902B 6DA3 CACD E19A A1C2 7B6E 35E7 3FE3 4790
To claim this, I am signing this object:
# Works just fine
uri = URI('https://api.twitter.com/1.1/statuses/mentions_timeline.json')
http = Net::HTTP.new(uri.hostname, uri.port)
http.use_ssl = true
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts res.body
@paweldudek
paweldudek / gist:acd0eeb749a2f00eda44
Created April 30, 2015 06:18
xcodebuild with coverage flags
xcodebuild test -workspace MyProject.xcworkspace -scheme MyScheme -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPad Air,OS=8.3" GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES OBJROOT=./build
@paweldudek
paweldudek / gist:12ad196b2617eed4219f
Created June 8, 2015 12:31
SQLCipher Unicode subspec
{
"name": "unicode61",
"dependencies": {
"SQLCipher/common": [
],
"SQLCipher/fts": [
]
},
@paweldudek
paweldudek / Usage.swift
Created November 21, 2023 11:45
Swift Class Dump Helpers
let actionClass: AnyClass = NSClassFromString("_UIImmutableAction")!
let functions = dumpFunctions(anyClass: actionClass)
let vars = dumpVars(anyClass: actionClass)
if let superclass = class_getSuperclass(actionClass) {
let functions = dumpFunctions(anyClass: superclass)
let vars = dumpVars(anyClass: superclass)
}