- Create or find a gist that you own.
- Clone your gist (replace
<hash>with your gist's hash):# with ssh git clone [email protected]:<hash>.git mygist # with https
git clone https://gist.github.com/.git mygist
| #define PSPDF_KEYPATH(object, property) (^{ \ | |
| _Pragma("clang diagnostic push") \ | |
| _Pragma("clang diagnostic ignored \"-Wunreachable-code\"") \ | |
| _Pragma("clang diagnostic ignored \"-Wimplicit-retain-self\"") \ | |
| return ((void)(NO && ((void)object.property, NO)), @#property); \ | |
| _Pragma("clang diagnostic pop") \ | |
| }()) |
<hash> with your gist's hash):
# with ssh
git clone [email protected]:<hash>.git mygist
# with httpsgit clone https://gist.github.com/.git mygist
| #import <UIKit/UIKit.h> | |
| #include <dlfcn.h> | |
| static const CFStringRef kMGDieID = CFSTR("DieId"); | |
| typedef NS_ENUM(NSInteger, BKSInterfaceOrientation) { | |
| BKSInterfaceOrientationPortrait = 1, | |
| BKSInterfaceOrientationPortraitUpsideDown = 2, | |
| BKSInterfaceOrientationLandscapeRight = 3, | |
| BKSInterfaceOrientationLandscapeLeft = 4 |
| # sync everything excluding things in .gitignore | |
| # delete anything on target not in source | |
| # include dotfiles and symlinks, also use compression | |
| rsync -azP --delete --filter=":- .gitignore" . my-target-host:/my/target/directory |
extension_id=jifpbeccnghkjeaalbbjmodiffmgedin # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc"
unzip -d "$extension_id-source" "$extension_id.zip"Thx to crxviewer for the magic download URL.
| First, let's create the $ subl command | |
| sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl | |
| Another option is to use duti (http://duti.org / https://github.com/moretension/duti). | |
| Run brew install duti, save a file like this as ~/.duti: | |
| com.sublimetext.3 public.plain-text all | |
| com.sublimetext.3 public.unix-executable all |
| #!/bin/bash | |
| set -ex | |
| # This scripts allows you to upload a binary to the iTunes Connect Store and do it for a specific app_id | |
| # Because when you have multiple apps in status for download, xcodebuild upload will complain that multiple apps are in wait status | |
| # Requires application loader to be installed | |
| # See https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/SubmittingTheApp.html | |
| # Itunes Connect username & password | |
| USER=bla |
| - (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| UITableViewRowAction *moreAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"More" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){ | |
| // maybe show an action sheet with more options | |
| [self.tableView setEditing:NO]; | |
| }]; | |
| moreAction.backgroundColor = [UIColor lightGrayColor]; | |
| UITableViewRowAction *blurAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Blur" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){ | |
| [self.tableView setEditing:NO]; | |
| }]; |
| /* | |
| One of the first things someone new to iOS Development finds is that dealing with the keyboard is trickier | |
| than they think it should be. Simply changing the scrolling extents of a UITableView (or UIScrollView, or | |
| UICollectionView) that is partially covered by they keyboard reveals a lot about the internals of how iOS | |
| works and highlights various "gotchas" that need to be considered. | |
| There are various ways to know that a keyboard has been shown - but observing some specific notifications | |
| provides a reliable way to allow you to modify your views to deal with it. |