Skip to content

Instantly share code, notes, and snippets.

View scelis's full-sized avatar

Sebastian Celis scelis

View GitHub Profile
@scelis
scelis / chpwd_update_git_vars.sh
Created November 27, 2009 20:16
Add git information to your ZSH prompt.
update_current_git_vars
@scelis
scelis / UIFont+CustomizedDynamicType.m
Created April 14, 2021 12:23 — forked from jverkoey/UIFont+CustomizedDynamicType.m
Dynamic Type system fonts with custom point sizes, weight, and italics
static const CGFloat kFontWeightEpsilon = FLT_EPSILON;
@implementation UIFont (CustomizedDynamicType)
+ (nonnull UIFont *)preferredFontWithDefaultSize:(CGFloat)size
textStyle:(nonnull UIFontTextStyle)textStyle {
return [self preferredFontWithDefaultSize:size
textStyle:textStyle
fontWeight:UIFontWeightRegular
italic:NO];
#!/usr/bin/env ruby
#
# This script can be used to check the in-store availability of the iPhone 5S.
# By default, it searches for all AT&T models. You can change this by editing
# the MY_DEVICES array below. While the Apple API supports searching for
# multiple devices at once, there is a limit.
#
# Once you have properly configured the MY_DEVICES array, you can run this script
# from the terminal. It takes a single parameter, which should be the zip code you
# wish to use for your search.
@scelis
scelis / UIButton+MOBlockCallbacks.h
Last active December 17, 2015 13:59
Adding block callback functionality to UIButton.
#import <UIKit/UIKit.h>
typedef void (^MOButtonCallback)(id sender);
@interface UIButton (MOBlockCallbacks)
// Adds a block callback for a set of UIControlEvents. This method returns an opaque token which
// can be used to remove the callback.
- (id)mo_addCallback:(MOButtonCallback)callback forControlEvents:(UIControlEvents)events;
//
// SCTimingViewController.m
// iOSTester
//
// Created by Sebastian Celis on 8/6/12.
//
#import <mach/mach.h>
#import <mach/mach_time.h>
#import "SCTimingViewController.h"
@scelis
scelis / gist:2062990
Created March 17, 2012 17:20
Instapaper 4.1 Crash Log (Scroll to Top)
Incident Identifier: D4A44777-0457-4E22-852B-9984CA14A740
CrashReporter Key: c4fa1c6f9ab63f0dc21c1ad60d842dcd1ff27ea2
Hardware Model: iPad3,1
Process: InstapaperPro [869]
Path: /var/mobile/Applications/7295E22C-20ED-44BA-9950-F6E8147B6A4A/InstapaperPro.app/InstapaperPro
Identifier: InstapaperPro
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
#ifdef MOLocalizationTable
#define MOLocalizedString(key, default) \
[[NSBundle mainBundle] localizedStringForKey:(key) value:(default) table:MOLocalizationTable]
#else
#define MOLocalizedString(key, default) \
[[NSBundle mainBundle] localizedStringForKey:(key) value:(default) table:nil]
#endif
@interface Restaurant : NSObject
+ (Restaurant)restaurant;
@end
+ (MySingleton *)sharedSingleton
{
static dispatch_once_t pred;
static MySingleton *instance = nil;
dispatch_once(&pred, ^{ instance = [[self alloc] init]; });
return instance;
}
@scelis
scelis / gist:335253
Created March 17, 2010 14:00
Retrieve a list of all fonts available on the iPhone.
NSArray *familyNames = [UIFont familyNames];
for (NSString *familyName in familyNames)
{
NSLog(@"Family: %@\n", familyName);
NSArray *fontNames = [UIFont fontNamesForFamilyName:familyName];
for (NSString *fontName in fontNames)
{
NSLog(@"\tFont: %@\n", fontName);
}
}