Skip to content

Instantly share code, notes, and snippets.


Manuel Binna mbinna

View GitHub Profile
jmtatsch / gist:44e7c1a55fc29432254bdc61559d91c7
Last active Apr 12, 2018
ROS Kinetic on Sierra Work in Progress
View gist:44e7c1a55fc29432254bdc61559d91c7
# NOTE: These instructions do not represent a robust, self-troubleshooting install; they
# are definitely not suitable for dumping to a giant script and running as one. If you
# use them, they should be run one at a time, with an eye out for errors or problems
# along the way.
# The #1 issue you are likely to encounter is with Homebrew or Python packages whose
# binary components link against system Python. This will result in runtime segfaults,
# especially in rviz. If you suspect this is occurring, you can attempt to remove and
# reinstall the offending packages, or go for the nuclear option--- empty your Cellar
# and site-packages folders and start over with brewed python from the beginning.
steipete / Macros.h
Last active Dec 12, 2020
Declare on your main init that all other init methods should call. It's a nice additional semantic warning. Works with Xcode 5.1 and above. Not tested with earlier variants, but should just be ignored. A reference to this macro shortly appeared in…
View Macros.h
#if __has_attribute(objc_designated_initializer)
#define NS_DESIGNATED_INITIALIZER __attribute((objc_designated_initializer))
lelandbatey /
Last active Jan 25, 2021
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!


This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"


rsobik /
Created Nov 17, 2013
Build Boost 1.55.0 for iOS 7 and OS X including 64 Bit
# Filename:
# Author: Pete Goodliffe
# Copyright: (c) Copyright 2009 Pete Goodliffe
# Licence: Please feel free to use this, with attribution
# Modified version
# Builds a Boost framework for the iPhone.
# Creates a set of universal libraries that can be used on an iPhone and in the
steipete / PSPDFUIKitMainThreadGuard.m
Last active Dec 11, 2020
This is a guard that tracks down UIKit access on threads other than main. This snippet is taken from the commercial iOS PDF framework, but relicensed under MIT. Works because a lot of calls internally call setNeedsDisplay or setNeedsLayout. Won't catch everything, but it's very lightweight and usually does the job.You might n…
View PSPDFUIKitMainThreadGuard.m
// Taken from the commercial iOS PDF framework
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
// Licensed under MIT (
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
// PLEASE DUPE rdar://27192338 ( if you would like to see this in UIKit.
#import <objc/runtime.h>
#import <objc/message.h>
steipete / PSPDFViewController.h
Last active Jun 6, 2017
This method will help to prevent a lot of emails about "weird bugs".
View PSPDFViewController.h
// Defines a yet undocumented method to add a warning if super isn't called.
#if __has_attribute(objc_requires_super)
#define NS_REQUIRES_SUPER __attribute((objc_requires_super))
@interface UIViewController (SubclassingWarnings)
iamleeg /
Created May 8, 2013
Creating objects on the stack, ObjC++ style.
@interface GLObject : NSObject
int _a;
- (void)logA;
struct GLObject_cpp {
ole /
Last active May 9, 2018
Automatically extract translatable strings from Xcode storyboards and update .strings files. Original version by MacRumors forum user mikezang ( Slightly updated by Ole Begemann. NOTE: this Gist moved to a regular repo at
# (File moved to
mayoff / makeAnimatedGif.m
Created Feb 16, 2013
Example of creating an animated GIF on iOS, with no 3rd-party code required. This should also be easy to port to OS X.
View makeAnimatedGif.m
#import <UIKit/UIKit.h>
#import <ImageIO/ImageIO.h>
#import <MobileCoreServices/MobileCoreServices.h>
static UIImage *frameImage(CGSize size, CGFloat radians) {
UIGraphicsBeginImageContextWithOptions(size, YES, 1); {
[[UIColor whiteColor] setFill];
CGContextRef gc = UIGraphicsGetCurrentContext();
CGContextTranslateCTM(gc, size.width / 2, size.height / 2);
drance / gist:4546014
Created Jan 16, 2013
Workaround to vanilla UICollectionView+UICollectionViewFlowLayout using non-integral origins, leading to blurry cells.
View gist:4546014
@implementation BHSCollectionViewFlowLayout
- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect {
NSArray *allAttrs = [super layoutAttributesForElementsInRect:rect];
for (UICollectionViewLayoutAttributes *attributes in allAttrs) {
attributes.frame = CGRectIntegral(attributes.frame);
return allAttrs;