Skip to content

Instantly share code, notes, and snippets.

@sey
sey / NFViewController.m
Created February 6, 2014 23:02
UITextField cursor positioning
//
// NFViewController.m
// TextFieldTest
//
// Created by Florian Sey on 06/02/14.
// Copyright (c) 2014 NeoFacto. All rights reserved.
//
#import "NFViewController.h"
Pod::Spec.new do |s|
s.name = 'JKBigInteger'
s.version = '1.0.0'
s.license = 'MIT'
s.homepage = 'https://github.com/kirsteins/JKBigInteger'
s.author = 'Jānis Kiršteins'
s.summary = 'JKBigInteger is a small library to facilitate easy working with big integers in Objective-C.'
s.source = { :git => 'https://github.com/kirsteins/JKBigInteger.git', :commit => '8eed2d1ba60f38933678c2363d2ae294c4a38c83' }
s.source_files = 'JKBigInteger/**/*.{c,h,m}'
s.requires_arc = true
@sey
sey / SVGKit.podspec
Last active December 21, 2015 05:58
SVGKit Podspec v1.1.0
# TODO JSONKit does *not* support GC, we need to specify that.
Pod::Spec.new do |s|
s.name = 'SVGKit'
s.version = '1.1.0'
s.summary = '.'
s.homepage = 'https://github.com/SVGKit/SVGKit'
s.author = 'adamgit'
s.source = { :git => 'https://github.com/SVGKit/SVGKit.git', :commit => 'f1eabd1861642362a705eb2a646c74c52eb893ea' }
@sey
sey / cordova_debug
Last active December 16, 2015 13:29
Cordova debug FileError codes
function debug() {
"use strict";
var errorsCode = [
{ 'FileError.NOT_FOUND_ERR': FileError.NOT_FOUND_ERR },
{ 'FileError.SECURITY_ERR': FileError.SECURITY_ERR },
{ 'FileError.ABORT_ERR': FileError.ABORT_ERR },
{ 'FileError.NOT_READABLE_ERR': FileError.NOT_READABLE_ERR },
{ 'FileError.ENCODING_ERR': FileError.ENCODING_ERR },
{ 'FileError.NO_MODIFICATION_ALLOWED_ERR': FileError.NO_MODIFICATION_ALLOWED_ERR },
{ 'FileError.INVALID_STATE_ERR': FileError.INVALID_STATE_ERR },
lsof -n -i4TCP:9000 | grep LISTEN
@sey
sey / debugCookies
Created November 10, 2012 15:35
debugCookies
+ (void)debugCookies
{
NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
[storage setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];
NSArray *cookies = [storage cookies];
for (NSHTTPCookie *cookie in cookies)
{
NSLog(@"cookie: %@", cookie);
}
}
@sey
sey / getUUID
Created November 10, 2012 15:34
getUUID
+ (NSString *)getUUID
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if ([defaults stringForKey:@"UUID"])
{
return [defaults stringForKey:@"UUID"];
}
else
{
CFUUIDRef theUUID = CFUUIDCreate(NULL);
@sey
sey / objective-c-singleton
Last active October 12, 2015 01:47
Singleton class constructor method. Makes use of instancetype (http://nshipster.com/instancetype/)
+ (instancetype)shared
{
static id shared;
static dispatch_once_t token;
dispatch_once(&token, ^{
shared = [[self alloc] init];
});
return shared;
}
@sey
sey / mp3tocaf
Created October 25, 2012 06:58
Convert mp3, wav to caf
/usr/bin/afconvert -f caff -d LEI16 {INPUT} {OUTPUT}
@sey
sey / xml_pretty
Created October 25, 2012 06:56
Pretty XML printing
xmllint --format xml_file.xml