This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in a UITableViewController (or any other view controller with a UITableView) | |
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator | |
{ | |
UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, size.width, 0)]; | |
header.translatesAutoresizingMaskIntoConstraints = NO; | |
// [add subviews and their constraints to header] | |
NSLayoutConstraint *headerWidthConstraint = [NSLayoutConstraint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ScenarioBindingConverter : IValueConverter | |
{ | |
public object Convert(object value, Type targetType, object parameter, string language) | |
{ | |
Scenario s = value as Scenario; | |
return (MainPage.Current.Scenarios.IndexOf(s) + 1) + ") " + s.Title; | |
} | |
public object ConvertBack(object value, Type targetType, object parameter, string language) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am yaakovgamliel on github. | |
* I am yaakov (https://keybase.io/yaakov) on keybase. | |
* I have a public key whose fingerprint is EE6F 212F 1509 3B2A EA88 54EA 4B04 7BD2 03AF 506D | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Observes a run loop to detect any stalling or blocking that occurs. | |
/// | |
/// This class is thread-safe. | |
@interface GHRunLoopWatchdog : NSObject | |
/// Initializes the receiver to watch the specified run loop, using a default | |
/// stalling threshold. | |
- (id)initWithRunLoop:(CFRunLoopRef)runLoop; | |
/// Initializes the receiver to detect when the specified run loop blocks for |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
msf > irb | |
[*] Starting IRB shell... | |
>> require 'method_source' | |
=> true | |
>> framework.db.method(:import_ip_list_file).source_location | |
=> ["/Users/sinn3r/rapid7/msf/lib/msf/core/db_manager/import/ip_list.rb", 18] | |
>> framework.db.method(:import_ip_list_file).parameters | |
=> [[:opt, :args]] | |
>> puts framework.db.method(:import_ip_list_file).source |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <unistd.h> | |
#include <mach/mach.h> | |
#include <mach/mach_vm.h> | |
#include <mach-o/dyld.h> | |
int | |
main (int argc, char * argv[]) | |
{ | |
volatile char * library; | |
const mach_vm_size_t page_size = getpagesize (); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define SWIZZLE_ADD_ANIMATION 0 | |
#if DEBUG && SWIZZLE_ADD_ANIMATION | |
+ (void)load { | |
safe_swap_implementation(self, @selector(addAnimation:forKey:), @selector(bb_addAnimation:forKey:)); | |
} | |
- (void)bb_addAnimation:(CAAnimation *)animation forKey:(NSString *)key { | |
// Ignore the stupid phantom text field's cursor animation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Performs `block` immediately and ignores subsequent calls during the same runloop. | |
#define pspdf_ensureCalledOnlyOncePerRunloop(block) do { \ | |
static const char __onceKey; _pspdf_ensureCalledOnlyOncePerRunloop(self, &__onceKey, block); } while(0) | |
extern void _pspdf_ensureCalledOnlyOncePerRunloop(id self, const void *key, dispatch_block_t block); | |
void _pspdf_ensureCalledOnlyOncePerRunloop(id self, const void *key, dispatch_block_t block) { | |
NSCParameterAssert(block); | |
NSCParameterAssert(self); | |
PSPDFAssertOnMainThread(); // run loop needs the main thread. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Nexmo.m | |
// | |
// Created by Tewodros Wondimu on 3/7/15. | |
// Contact: tewodroswondimu@gmail.com | |
// Copyright (c) 2015 Tewodros Wondimu. All rights reserved. | |
// | |
#import "Nexmo.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
font-size: 12pt; | |
font-family: monospace; | |
font-weight: normal; | |
font-style: normal; | |
text-decoration: none; | |
color: black; | |
cursor: default; | |
} |
OlderNewer