Skip to content

Instantly share code, notes, and snippets.

View ElDragonRojo's full-sized avatar

Mike Lee ElDragonRojo

View GitHub Profile
@ElDragonRojo
ElDragonRojo / RulesFor3rdPartyFrameworks.md
Last active December 6, 2016 07:14
My rules for creating and using 3rd party frameworks (i.e. those not part of the platform's standard toolkit).

Rule 0: Do not make a framework.

Ask yourself if you should be making a framework given that you are not in the business of making frameworks. Believe it or not, most of us have the urge to solve problems completely and in the general case as our first inclination, but getting things done requires not doing so almost all of the time.

Rule 1: Do not have dependencies on other 3rd party frameworks.

Frameworks should be modular and standalone. They should require nothing but the standard system libraries in order to run. If the framework relies on other functionality, it should encompass it entirely. If it cannot, it probably violates Rule 3.

Rule 2: Use a non-viral open-source license like MIT or Apache, NOT GPL.

@ElDragonRojo
ElDragonRojo / gist:6098675
Created July 28, 2013 13:59
Suppress the warning clang emits about PerformSelector. If you'd rather use a selector name, replace `@selector(selectorName:)` with `NSSelectorFromString(selectorName)`
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
[self performSelector:@selector(selectorName:) withObject:nil];
#pragma clang diagnostic pop
@ElDragonRojo
ElDragonRojo / CrushPDFsWithoutSacrificingQuality
Last active December 20, 2015 04:29
This incantation is what @spllr used to reduce the file size of the New Lemur's [Reviewer's Guide](http://assets.newlemurs.com/press/Reviewers-Guide/Lemurs-Chemistry-Water-Reviewers-Guide.pdf) ## About `gs` This uses [ghostscript](http://pages.uoregon.edu/koch/). [Learn more.](http://linux.about.com/library/cmd/blcmdl1_gs.htm)
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf