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
// | |
// UIDeviceHardware.h | |
// | |
// Used to determine EXACT version of device software is running on. | |
#import <Foundation/Foundation.h> | |
@interface UIDeviceHardware : NSObject | |
- (NSString *) platform; |
#!/bin/sh | |
# Create a RAM disk with same perms as mountpoint | |
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions | |
# Usage: sudo ./xcode_ramdisk.sh start | |
USERNAME=$(logname) | |
TMP_DIR="/private/tmp" | |
RUN_DIR="/var/run" | |
SYS_CACHES_DIR="/Library/Caches" |
#!/usr/bin/ruby | |
require "getoptlong" | |
getoptlong = GetoptLong.new( | |
[ '--target', '-t', GetoptLong::REQUIRED_ARGUMENT ], | |
[ '--log-file', '-l', GetoptLong::REQUIRED_ARGUMENT ], | |
[ '--source-root', '-r', GetoptLong::REQUIRED_ARGUMENT ] | |
) |
+(CGFloat)pixelToPoints:(CGFloat)px { | |
CGFloat pointsPerInch = 72.0; // see: http://en.wikipedia.org/wiki/Point%5Fsize#Current%5FDTP%5Fpoint%5Fsystem | |
CGFloat scale = 1; // We dont't use [[UIScreen mainScreen] scale] as we don't want the native pixel, we want pixels for UIFont - it does the retina scaling for us | |
float pixelPerInch; // aka dpi | |
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { | |
pixelPerInch = 132 * scale; | |
} else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { | |
pixelPerInch = 163 * scale; | |
} else { | |
pixelPerInch = 160 * scale; |
{"UIDeviceFamily":[1,2]} |
alias subadd="svn st | grep '^?' | sed 's/^? *\(.*\)/\"\1\"/g' | sed 's/@\(.*\)/@\1@/g' | xargs svn add" | |
alias subrm="svn st | grep '^!' | sed 's/^! *\(.*\)/\"\1\"/g' | sed 's/@\(.*\)/@\1@/g' | xargs svn rm" | |
alias subst='svn st' | |
alias subci='svn ci' | |
alias subup='svn up' |
license: gpl-3.0 | |
redirect: https://observablehq.com/@d3/d3-collapsible-tree |
use List::MoreUtils qw( each_array ); | |
my @first = qw( foo bar buzz ); | |
my @second = (1, 2, 3); | |
my $it = each_array( @first, @second ); | |
while ( my ($f, $s) = $it->() ) { | |
print "$f = $s\n"; | |
} |
// | |
// UIDevice+DeviceHardware.h | |
// | |
// Used to determine EXACT version of device software is running on. | |
#import <Foundation/Foundation.h> | |
#include <sys/types.h> | |
#include <sys/sysctl.h> | |
typedef enum { |