Skip to content

Instantly share code, notes, and snippets.

View rbsgn's full-sized avatar

Roman Busygin rbsgn

  • Dodo Engineering
  • Moscow
  • X @rbsgn
View GitHub Profile
// YSTableViewCells.h
//
// A set of cells for implementing Preferences-like tables.
//
// Copyright (c) 2009, Andrey Tarantsov <andreyvit@gmail.com>
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
From a5c94fbb8f6bae89378795dfd7e84d4fe8f66897 Mon Sep 17 00:00:00 2001
From: Roman Busyghin <nskboy@gmail.com>
Date: Wed, 21 Apr 2010 11:12:00 +0400
Subject: [PATCH] Resize view controller view automatically
---
Examples/ImageDemo/MainWindow.xib | 96 ++++++++++++++++++++++++++++++++++++-
1 files changed, 94 insertions(+), 2 deletions(-)
diff --git a/Examples/ImageDemo/MainWindow.xib b/Examples/ImageDemo/MainWindow.xib
<link rel="apple-touch-icon-precomposed" media="screen and (resolution: 163dpi)" href="/link/to/iOS-57px.png" />
<link rel="apple-touch-icon-precomposed" media="screen and (resolution: 132dpi)" href="/link/to/iOS-72px.png" />
<link rel="apple-touch-icon-precomposed" media="screen and (resolution: 326dpi)" href="/link/to/iOS-114px.png" />
The addition of -precomposed stops iOS from automatically rendering
gloss atop my icon and rounding it’s corners. If you do want iOS to
auto-apply the gloss and rounded corners automatically (so you can
supply a flat, square image), simply use rel=“apple-touch-icon”.
/*
* Adds the serialNumber property to the UIDevice class
*
* The implementation uses undocumented (for iOS) IOKit functions,
* so handle with caution and be prepared for nil.
*/
#import <UIKit/UIDevice.h>
@interface UIDevice (serialNumber)
@rbsgn
rbsgn / gist:839347
Created February 22, 2011 20:41 — forked from Machx/gist:838075
// NSURLConnection wrapper
// like NSURLConnection, requires a runloop, callbacks happen in runloop that set up load
@interface LDURLLoader : NSObject
{
NSURLConnection *_connection;
NSTimeInterval _timeout;
NSTimer *_timeoutTimer;
NSURLResponse *_response;
long long _responseLengthEstimate;
NSMutableData *_accumulatedData;
#import <Foundation/Foundation.h>
@interface NSObject (YXDebug)
- (NSString *)yx_description;
@end
@rbsgn
rbsgn / UIView-YXDebug.h
Created March 19, 2011 16:44
Debugging mode for UIViews: Dumps subviews description to console
#import <UIKit/UIKit.h>
@interface UIView (YXDebug)
- (NSString *)subtreeDescription;
@end
@rbsgn
rbsgn / CALayer-YXDebug.h
Created March 19, 2011 16:57
Debugging mode for CALayers: highlights borders and dumps sublayers as images
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
@interface CALayer (YXDebug)
- (UIImage *)snapshot;
- (void)dumpSublayerImagesToFolder:(NSString *)folderPath;
- (void)highlightSublayerBorders;
@end
@rbsgn
rbsgn / blame.rb
Created May 13, 2011 14:18 — forked from soffes/blame.rb
Find the number of lines of code per person in a repository
# Put this file in the root of your git repository then run `ruby blame.rb`.
# You will need gsed. You can install gsed with `brew install gsed`.
# Crazy shell script taken from http://stackoverflow.com/questions/4589731/git-blame-statistics
input = `git ls-tree -r HEAD|gsed -re 's/^.{53}//'|while read filename; do file "$filename"; done|grep -E ': .*text'|gsed -r -e 's/: .*//'|while read filename; do git blame "$filename"; done|gsed -r -e 's/.*\\((.*)[0-9]{4}-[0-9]{2}-[0-9]{2} .*/\\1/' -e 's/ +$//'|sort|uniq -c`
aggregated = {}
input.lines.each do |line|
line.strip!
@rbsgn
rbsgn / openvpn-keychain.diff
Created October 23, 2011 17:17
Openvpn patch that allows loading of VPN certificate from Mac OS X keychain. Originally created by Brian Raderman (<brian@irregularexpression.org>).
From a53d19a34be1301c4f4c37e9767ca698885b84fb Mon Sep 17 00:00:00 2001
From: Roman Busyghin <nskboy@gmail.com>
Date: Sun, 23 Oct 2011 20:37:52 +0400
Subject: [PATCH] Ability to lookup OS X keychain to load VPN certificate
This patch is created by Brian Raderman <brian@irregularexpression.org> and modified a bit in order to be compiled with make instead of Xcode
---
Makefile.am | 9 +
cert_data.c | 631 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
cert_data.h | 44 ++++