Skip to content

Instantly share code, notes, and snippets.

View kishikawakatsumi's full-sized avatar
🏠
Working from home

Kishikawa Katsumi kishikawakatsumi

🏠
Working from home
View GitHub Profile
@BanzaiMan
BanzaiMan / README.md
Last active August 29, 2015 14:00
XCode code signing issue with OS X Mavericks images

Issue

Users report issues with code signing their Objective-C based project with the newly-rolled out Mavericks image on Travis CI.

The error looks something like:

Code Sign error: No codesigning identities found: No codesigning identities (i.e. certificate and private key pairs) that match the provisioning profile specified in your build settings ("Chappy Dev Adhoc") were found. CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 7.1'

Workaround

A couple of users have reported that setting the keychain in use to be the default will fix this issue. For example:

@kishikawakatsumi
kishikawakatsumi / ImageUpload.m
Created November 23, 2011 15:13
Upload image to Twitter with OAuth
#define DATA(str) [(NSString*)(str) dataUsingEncoding:NSUTF8StringEncoding]
- (NSData *)generateFormData:(NSDictionary *)dictionary boundary:(NSString *)boundary {
NSMutableData *data = [[NSMutableData alloc] init];
id key;
NSEnumerator *enumerator = [dictionary keyEnumerator];
while (key = [enumerator nextObject]) {
id value = [dictionary valueForKey:key];
[data appendData:DATA(([NSString stringWithFormat:@"--%@\r\n", boundary]))];
@norio-nomura
norio-nomura / gist:3937593
Created October 23, 2012 08:15
superに任意のメッセージを送る方法
#import <objc/objc-runtime.h>
// [super description];
struct objc_super s = {self, [self superclass]};
objc_msgSendSuper(&s, @selector(description));
#import <Foundation/Foundation.h>
#import "sqlite3.h"
typedef int64_t timestamp;
NSUInteger randomNumberInRange(NSUInteger start, NSUInteger end);
// Create a sample date using the ISO-8601 format.
// 2013-04-23T16:29:05Z
NSString* generateSampleDate();
@akisute
akisute / FontTesterPlayground.swift
Created August 17, 2016 07:35
Font Tester Playground. You can learn how text is drawn and affected by various settings.
//: Playground - noun: a place where people can play
import UIKit
import XCPlayground
// To continue running NSURLSession async download, make this playground page keep running
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true
let font = UIFont.systemFontOfSize(16.0)
@fdstevex
fdstevex / gist:6741638
Created September 28, 2013 12:34
Method to retrieve a list of downloadable fonts on iOS 7. This method may block for a while (it can involve a network call) so don't call on main thread. The return is a dictionary that maps font families to arrays of font names in that family.
+ (NSDictionary *)downloadableFonts
{
CTFontDescriptorRef desc = CTFontDescriptorCreateWithAttributes((CFDictionaryRef)@{(id)kCTFontDownloadableAttribute : (id)kCFBooleanTrue});
CFArrayRef matchedDescs = CTFontDescriptorCreateMatchingFontDescriptors(desc, NULL);
NSArray *array = (__bridge NSArray *)matchedDescs;
NSMutableDictionary *families = [NSMutableDictionary dictionary];
for (UIFontDescriptor *fontDescriptor in array) {
NSString *familyName = fontDescriptor.fontAttributes[UIFontDescriptorFamilyAttribute];
@n00neimp0rtant
n00neimp0rtant / gist:27829d87118d984232a4
Last active May 24, 2019 15:10
UIVisualEffectView blur radius manipulation (new for iOS 9)
// iOS 9 allows you to animate between visual effects, which gives you the
// ability to manipulate the blur radius. this can be useful for animating
// a backdrop for a custom modal, and with a few tricks, can even be set
// indirectly, allowing you to "scrub" between them back and forth with
// a gesture, just like when you pull down Spotlight.
// these are the two effects you want to transition between
UIVisualEffect *startEffect = nil; // "nil" means no blur/tint/vibrancy (plain, fully-transparent view)
UIVisualEffect *endEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
@rpetrich
rpetrich / UIScale.h
Created March 9, 2012 00:37
Convenience functions for getting the screen scale and rounding metrics relative to it.
#import <UIKit/UIKit.h>
#define UI_MAIN_SCREEN_SCALE() ([UIScreen instancesRespondToSelector:@selector(scale)] ? [UIScreen mainScreen].scale : 1.0f)
static inline CGFloat CGFloatRoundToScale(CGFloat value, CGFloat scale)
{
return roundf(value * scale) / scale;
}
static inline CGFloat CGFloatRoundToMainScreen(CGFloat value)
@johanneswuerbach
johanneswuerbach / .travis.yml
Last active April 14, 2023 20:31
Deploy an iOS app to testflight using Travis CI
---
language: objective-c
before_script:
- ./scripts/travis/add-key.sh
after_script:
- ./scripts/travis/remove-key.sh
after_success:
- ./scripts/travis/testflight.sh
env:
global:
@jedi4ever
jedi4ever / upload-to-appstore.sh
Created August 18, 2014 12:13
Command upload App/Ipa to the iTunes Connect App Store
#!/bin/bash
set -ex
# This scripts allows you to upload a binary to the iTunes Connect Store and do it for a specific app_id
# Because when you have multiple apps in status for download, xcodebuild upload will complain that multiple apps are in wait status
# Requires application loader to be installed
# See https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/SubmittingTheApp.html
# Itunes Connect username & password
USER=bla