Generates PDF from man page and opens it within Preview.app.
curl -o /usr/local/bin/pman https://gist.githubusercontent.com/AlexDenisov/4294335/raw/9fe40c81f6fc94760e81040d2636d0e703fc676f/pman.pl
chmod +x /usr/local/bin/pman
| cmake_minimum_required(VERSION 2.8.12) | |
| project(OSXRPath) | |
| # enable @rpath in the install name for any shared library being built | |
| set(CMAKE_MACOSX_RPATH 1) | |
| # add a shared library | |
| add_library(foo SHARED foo.cpp) |
| // Taken from the commercial iOS PDF framework http://pspdfkit.com. | |
| // Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
| // Licensed under MIT (http://opensource.org/licenses/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 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit. | |
| #import <objc/runtime.h> | |
| #import <objc/message.h> |
| #define USE_ROBIN_HOOD_HASH 1 | |
| #define USE_SEPARATE_HASH_ARRAY 1 | |
| template<class Key, class Value> | |
| class hash_table | |
| { | |
| static const int INITIAL_SIZE = 256; | |
| static const int LOAD_FACTOR_PERCENT = 90; | |
| struct elem |
| #! /usr/bin/env bash | |
| # Target and build configuration. | |
| TARGET=arm-none-eabi | |
| PREFIX=/opt/arm-none-eabi-4.7.1 | |
| # Sources to build from. | |
| BINUTILS=binutils-2.23.1 | |
| GCC=gcc-4.7.1 | |
| NEWLIB=newlib-1.20.0 |
| #define EMKStringableEnum(ENUM_NAME, ENUM_VALUES...) \ | |
| \ | |
| typedef enum { \ | |
| ENUM_VALUES \ | |
| } ENUM_NAME; \ | |
| \ | |
| \ | |
| \ | |
| static NSString * ENUM_NAME##ToString(int enumValue) { \ | |
| static NSString *enumDescription = @"" #ENUM_VALUES; \ |
Howdy howdy, NSHipsters!
If you alloc init an NSCalendar, you'll notice that New Year's Eve falls on a Monday this year, a.k.a. "the day NSHipster is published every week". What fun!
So in celebration of the upcoming year++, I thought it'd be fun to compile a list of some of your favorite tips and tricks of the trade. Submit your favorite piece of Objective-C trivia, framework arcana, hidden Xcode feature, or anything else you think is cool, and you could have it featured in the year-end blowout article. Just comment on this gist below!
Here are a few examples of the kind of things I'd like to see:
| # A sample Gemfile | |
| source "https://rubygems.org" | |
| gem 'mechanize' |
| # Simple approach to sending email from the Rails console | |
| # Implementation idea courtesy of Steve Klabnik | |
| # http://blog.steveklabnik.com/posts/2012-09-09-random-ruby-tricks--class-new | |
| # Create the mailer class with a block and assign to a variable | |
| mailer = Class.new(ActionMailer::Base) do | |
| def example_message | |
| mail(to: "[email protected]", from: "[email protected]", subject: "Example Message") do |format| | |
| format.text { render text: "Example message body" } | |
| end |