Skip to content

Instantly share code, notes, and snippets.

View mwhuss's full-sized avatar

Marshall Huss mwhuss

View GitHub Profile
@mwhuss
mwhuss / PagingScrollView.mm
Created January 13, 2013 18:42
Paging Scroll View
UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), CGRectGetHeight(self.view.bounds))];
scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
scrollView.pagingEnabled = YES;
[self.view addSubview:scrollView];
NSArray *images = @[@"image1", @"image2", @"image3"];
[images enumerateObjectsUsingBlock:^(NSString *imageName, NSUInteger idx, BOOL *stop) {
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:imageName]];
imageView.frame = CGRectMake(idx * CGRectGetWidth(self.view.bounds), 0, CGRectGetWidth(self.view.bounds), CGRectGetHeight(self.view.bounds));
[self.scrollView addSubview:imageView];
@mwhuss
mwhuss / Podfile
Created September 26, 2013 20:43
Treehouse Podfile
platform :ios, '6.0'
pod 'AFNetworking', '1.3.1'
pod 'EDColor', '0.2.0'
pod 'ActiveSupportInflector', '0.0.1'
pod 'SSKeychain', '1.2.1'
pod 'SSDataKit', '0.1.5'
pod 'MetricsKit', '0.2.1'
pod 'PonyDebugger', '0.3.0'
pod 'SAMTextField', :head
module APNS
module Treehouse
class DebugWorker
include APNS::Worker
apns_options build_type: 'com.teamtreehouse.TreehouseDebug',
production: false
end
end
end
# find mound point
diskutil list
# unmount disk, use mount point
diskutil unmountDisk /dev/disk4
# flash img to USB >= 2GB
sudo dd if=./litecoinbamt1.1.img of=/dev/disk4 count=1 bs=512
"intensity" : "20,20",
"vectors" : "1,1",
"worksize" : "256,256",
"kernel" : "scrypt,scrypt",
"lookup-gap" : "2,2",
"thread-concurrency" : "24000,24000",
"shaders" : "0,0",
"gpu-engine" : "0-1085,0-1085",
"gpu-fan" : "0-100,0-100",
"gpu-memclock" : "1375,1375",
@mwhuss
mwhuss / macs.md
Last active January 3, 2016 03:38
Macs for sale

The sun has set, the kids are in bed, and you've made yourself a hot cup of tea. Time to curl up on the couch to play that new game everyone's been talking about. You're about to get the high score and...

wall

The App crashes.

Nothing ruins an App experience like a crash; abruptly leaving users staring at their home screen. As a mobile developer, crashes are just a fact of life. Sometimes they aren't even your fault and exist in a 3rd party library or the iOS framework, but the user doesn't really care. When a crash happens it can sometimes result in a ★☆☆☆☆ review.

bad review

@interface SNDayView ()
@property (nonatomic, strong) UILabel *titleLabel;
@end
@implementation SNDayView
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];

Keybase proof

I hereby claim:

  • I am mwhuss on github.
  • I am mwhuss (https://keybase.io/mwhuss) on keybase.
  • I have a public key whose fingerprint is CD44 F91D 51D3 285B D133 E266 D65C FF2A D866 6DAC

To claim this, I am signing this object:

@mwhuss
mwhuss / caleb.txt.asc
Created March 11, 2014 23:48
For Caleb
-----BEGIN PGP MESSAGE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
hQEMA67Di7ThR9PFAQgAkPMoyW0t7hpSvrUD3E0kb2OVw3t6qtC1doStfSmyLj2F
PflWJ+TXqGJlVPONr79+SACf3L2YsOxAeMPOZgxZP9EXO89SS1XRBi7bMuQ03jRK
/V0UT1on/ShnyOWinTdt8/0Z03JumJUzTALoUwogUyAjCdi+w+O1vxGuXPWkJD6K
N9pbySkHW2RzIU5s2SkC6/ELYDAMcKR1K0NQIExMqBhbCMhzZxBtV+3NfmyoH6i7
uw+ujSo2GRQU1lpHXiwH+cL/Oic+2edAYK89vg13WMcbYPLV3zRG7PWiHM5HdmfY
aEOVHa87qG0uU0U16/lPQneTWa6Xhwcm0DgVx2ZMMtJfAepr9QGfdAR4njw7q3uL
IDX+DqeVSnaaSkd24PL/bDIZycDzprJI0v4yyQsErzM9UVkFaIr601xvivkk/3KS