Skip to content

Instantly share code, notes, and snippets.

View ariiyu's full-sized avatar

Yusuke Ariyoshi ariiyu

View GitHub Profile
@zacwest
zacwest / ios-font-sizes.swift
Last active May 6, 2024 13:04
iOS default font sizes - also available on https://www.iosfontsizes.com
let styles: [UIFont.TextStyle] = [
// iOS 17
.extraLargeTitle, .extraLargeTitle2,
// iOS 11
.largeTitle,
// iOS 9
.title1, .title2, .title3, .callout,
// iOS 7
.headline, .subheadline, .body, .footnote, .caption1, .caption2,
]
@nacookan
nacookan / resize2iosapp
Created May 21, 2014 06:56
iOSアプリ用アイコンに一括リサイズ
#! /bin/bash
source=$1
path="${source}_icons"
mkdir -p $path
sips --resampleWidth 57 --out $path/Icon.png $source # 57 x 57 for iPhone non-Retina iOS6 App
sips --resampleWidth 114 --out $path/Icon@2x.png $source # 114 x 114 for iPhone Retina iOS6 App
sips --resampleWidth 72 --out $path/Icon-72.png $source # 72 x 72 for iPad non-Retina iOS6 App
@mmick66
mmick66 / UICollectionViewFlowLayoutCenterItem.m
Last active August 2, 2022 10:06
UICollectionViewFlowLayout with arbitrary sized Paging
#import "UICollectionViewFlowLayoutCenterItem.h"
@implementation UICollectionViewFlowLayoutCenterItem
- (CGPoint)targetContentOffsetForProposedContentOffset:(CGPoint)proposedContentOffset withScrollingVelocity:(CGPoint)velocity
{
CGSize collectionViewSize = self.collectionView.bounds.size;
CGFloat proposedContentOffsetCenterX = proposedContentOffset.x + self.collectionView.bounds.size.width * 0.5f;
CGRect proposedRect = self.collectionView.bounds;
@border
border / mgoExample.go
Created August 27, 2012 15:33
mgo example
package main
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"time"
)
type Person struct {