Skip to content

Instantly share code, notes, and snippets.

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

KAWASHIMA Yoshiyuki ykws

🏠
Working from home
View GitHub Profile
@bignerdranch
bignerdranch / BNRTimeBlock.h
Created March 9, 2012 13:51
Timing Utility Post 20120308
CGFloat BNRTimeBlock (void (^block)(void));
@snikch
snikch / gist:3661188
Created September 6, 2012 23:16
Find the current top view controller for your iOS application
- (UIViewController *)topViewController{
return [self topViewController:[UIApplication sharedApplication].keyWindow.rootViewController];
}
- (UIViewController *)topViewController:(UIViewController *)rootViewController
{
if (rootViewController.presentedViewController == nil) {
return rootViewController;
}
@hidsh
hidsh / split_str
Created August 25, 2013 00:18
Python: 文字列を文字数で分割する
def split_str(s, n):
"split string by its length"
length = len(s)
return [s[i:i+n] for i in range(0, length, n)]
if __name__ == '__main__':
print(split_str('qwertyuiop', 2))
print(split_str('qwertyuiop', 3))
+(void)generateKeyPairWithPublicTag:(NSString *)publicTagString privateTag:(NSString *)privateTagString {
NSMutableDictionary *privateKeyAttr = [[NSMutableDictionary alloc] init];
NSMutableDictionary *publicKeyAttr = [[NSMutableDictionary alloc] init];
NSMutableDictionary *keyPairAttr = [[NSMutableDictionary alloc] init];
NSData *publicTag = [publicTagString dataUsingEncoding:NSUTF8StringEncoding];
NSData *privateTag = [privateTagString dataUsingEncoding:NSUTF8StringEncoding];
SecKeyRef publicKey = NULL;
SecKeyRef privateKey = NULL;
@suryart
suryart / application.html.erb
Last active October 26, 2023 00:16
Rails 4 flash messages using Twitter Bootstrap(bootstrap-sass: https://github.com/thomas-mcdonald/bootstrap-sass). An improved version of https://gist.github.com/roberto/3344628
// layout file
<body>
<div class="container">
<%= flash_messages %>
<%= yield %>
</div><!-- /container -->
</body>
@Kuniwak
Kuniwak / 2013_11_15_githubjp_note.markdown
Last active October 30, 2018 07:06
「GitHub トレーニングチームから学ぶ Git の内部構造」のノートです。 曖昧なところもあるので、間違いがあったら教えてください! http://connpass.com/event/3808/

GitHub トレーニングチームから学ぶ Git の内部構造

Graphs, Hashes, and Compression, Oh My!

Hash について

従来の CVCS (集中バージョン管理システム)のリビジョン番号は連番。 SVN はサーバーにデプロイした時点でリビジョン番号1と設定される。

@roothybrid7
roothybrid7 / file0.txt
Created March 12, 2014 11:29
Xcode 5.1にupdateした後に、使えなくなったxcode plug-inを再び使えるようにする方法 ref: http://qiita.com/roothybrid7/items/85bacb992a22aaad04cd
find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist | xargs -IFILE defaults write FILE DVTPlugInCompatibilityUUIDs -array-add A2E4D43F-41F4-4FB9-BB94-7177011C9AED
@sambaiz
sambaiz / button.kt
Last active December 2, 2018 21:57
Kotlin Android
val button: Button = findViewById(R.id.Button02) as Button
button setOnClickListener (object: View.OnClickListener {
public override fun onClick(view: View): Unit {
}
})
@uebo
uebo / Default-568h@2x.png
Last active October 12, 2022 01:41
iOS Sample Launch Screen File
Default-568h@2x.png
@tdksk
tdksk / UILabel+TDKUtil.m
Created November 27, 2014 13:29
UILabel setLineHeightMultiple:
#import "UILabel+TDKUtil.h"
@implementation UILabel (TDKUtil)
- (void)setLineHeightMultiple:(CGFloat)lineHeightMultiple
{
NSMutableAttributedString *attributedString = [self.attributedText mutableCopy];
NSMutableParagraphStyle *paragrahStyle = [NSMutableParagraphStyle new];
paragrahStyle.lineHeightMultiple = lineHeightMultiple;