CGRectIntegral is a function for rounding all the values of a CGRect at once, typically used for snapping frames to pixels. For a good example of how this helps prevent image blurring and other related rendering issues see this stackoverflow answer. On retina screens CGRectIntegral still rounds to the nearest point (1.0) rather than the… Continue reading Retina alterative to CGRectIntegral
Author: Paul
Mac constantly switching to a new finder window when the space key is pressed
If whenever you press the space key your mac shifts focus to a finder window you should be able to fix it by hard booting Finder. Open terminal and run: killall Finder
Unarchiving 7z files on OS X
Brew is always saving the day. # Install p7zip brew install p7zip # extract 7z x file.7z
Quick Browser Detection One Liners
// You can expand this out in any line below // but it makes things much more readable var ua = navigator.userAgent.toString().toLowerCase(); //Browsers var IE6 = false /*@cc_on || @_jscript_version < 5.7 @*/ var IE7 = (document.all && !window.opera && window.XMLHttpRequest && ua.indexOf(‘trident/4.0’) == -1) ? true : false; var IE8 = (ua.indexOf(‘trident/4.0’) != -1);… Continue reading Quick Browser Detection One Liners
Vertical space in bootstrap
I use Bootstrap for most personal projects lately but one thing that consistently gets me is the lack of vertical spacing classes. Quick fix I added these classes to my bootstrap stylesheet .voffset { margin-top: 2px; } .voffset1 { margin-top: 5px; } .voffset2 { margin-top: 10px; } .voffset3 { margin-top: 15px; } .voffset4 { margin-top:… Continue reading Vertical space in bootstrap
Checking if a UITableViewCell is fully visible
Sometime you need to know if a UITableViewCell is completely visible and for those times there’s this handy UITableViewCell category. //Place in UITableViewCell Category – (BOOL) isCompletelyVisible { // For parents category see pdenya.com/g/uiview_parents UITableView *tableview = (UITableView *)[self parents:[UITableView class]]; CGRect rect = [tableview rectForRowAtIndexPath:[tableview indexPathForCell:self]]; rect = [tableview convertRect:rect toView:tableview.superview]; BOOL completelyVisible =… Continue reading Checking if a UITableViewCell is fully visible
HelloSign for Gmail
HelloSign for Gmail is a browser extension for Chrome, FireFox and Safari that lets users fill out and sign documents without ever leaving Gmail. The user clicks the sign button next to an attachment and the file is uploaded to HelloSign and the HelloSign editor is opened in a lightbox for the user to sign… Continue reading HelloSign for Gmail
Tap anywhere else to cancel in Objective C
Whenever you have a modal element that outside touches should cancel a few things need to happen: Touches inside the modal element should behave normally Outside touches should not trigger touch events on tappable elements Outside touches should trigger a handler to close the modal In my case I was swiping a UITableViewCell and revealing… Continue reading Tap anywhere else to cancel in Objective C
Hiding the WP Admin Bar
There’s a few plugins for hiding the WordPress admin bar that shows up on top of your site when you’re logged in but it seems like overkill. If you don’t care about preventing it from loading you can drop this in your stylesheet at wp-admin/themes.php?page=editcss to hide it. html { margin-top: 0!important; } #wpadminbar {… Continue reading Hiding the WP Admin Bar
Accepting developer roles on facebook
Log into Facebook and go to https://developers.facebook.com/apps. Register as a developer if you haven’t yet This process is a pain and involves entering your phone number and receiving a confirmation text. Check for invites You should get a notification at the top about any pending invites. Click through and confirm.