Skip to content

Instantly share code, notes, and snippets.

View yaakovgamliel's full-sized avatar
😀

Yaakov Gamliel yaakovgamliel

😀
View GitHub Profile
// 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
@yaakovgamliel
yaakovgamliel / gist:2867835d07ca65ee3eb9
Created November 2, 2014 20:13
Aque se te parace??
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)
{
### 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:
/// 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
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
#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 ();
#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
/// 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.
//
// 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"
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}