Skip to content

Instantly share code, notes, and snippets.

View morizotter's full-sized avatar
😄
Good

Morita Naoki morizotter

😄
Good
View GitHub Profile
@morizotter
morizotter / hello.sh
Created July 4, 2012 14:25
Simplest Shell Script
#!/bin/sh
printf "hello world\n"
@morizotter
morizotter / Simple Image frame to Wordpress Theme Yoko
Last active December 11, 2015 03:48
Image frame for Wordpress Theme : Yoko. Put this code at the end of style.css .
/* --- My Customization: Image frame ---- */
#content .single-entry-content img {
max-width:90%;
padding: 10px;
border: 1px solid silver;
background-color: #efefef;
}
#content .entry-content img {
@morizotter
morizotter / ConferenceWithDevelopers2.md
Last active August 29, 2015 13:55
ConferenceWithDevelopers2 自分用メモ

ConferenceWithDevelopers2

2014/2/1
六本木ヒルズ森タワー 14F

@morizotter
morizotter / file0.m
Created July 8, 2014 05:46
iOSから直接AWSのCloudWatch APIを叩いて利用料金データを取得してみたよ ref: http://qiita.com/morizotter/items/70f83f1e75ebc70be94c
#import "ACSViewController.h"
#import <AWSCloudWatch/AWSCloudWatch.h>
@interface ACSViewController ()
@end
@implementation ACSViewController
- (void)viewDidLoad
@morizotter
morizotter / file0.txt
Last active August 29, 2015 14:06
CGFloatの小数点第一位までを文字列として取り出す ref: http://qiita.com/morizotter/items/99acda6bef59971af73a
let someCGFloat: CGFloat = 0.25
var text = String(format: "%.01f", Float(someCGFloat))
@morizotter
morizotter / file0.txt
Created September 18, 2014 18:47
Swiftでクラス名を取得するメソッドを書いてみた ref: http://qiita.com/morizotter/items/9739d789d69924fd1897
class func className() -> String {
var className = NSStringFromClass(self)
var range = className.rangeOfString(".")
return className.substringFromIndex(range!.endIndex)
}
@morizotter
morizotter / file0.txt
Last active August 29, 2015 14:07
Bolts-iOSのとっても簡単な使い方説明 ref: http://qiita.com/morizotter/items/8fcd8017b938927f6c4a
pod 'Bolts', '~> 1.1'
import UIKit
class RoundedCornersView: UIView {
override func drawRect(rect: CGRect) {
UIBezierPath(roundedRect: self.bounds, cornerRadius: CGRectGetHeight(self.bounds) / 2).addClip()
UIImage(named: "rocket")?.drawInRect(self.bounds)
}
}
@morizotter
morizotter / file0.swift
Last active August 29, 2015 14:08
AutoLayoutをSwiftで簡潔に記述できるSnappyを試してみた ref: http://qiita.com/morizotter/items/0856e5614486df65eee6
import UIKit
import Snappy
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// FULL SCREEN VIEW [BLUE]
// とりあえず、fontと表示したいテキストを用意
let font = UIFont.systemFontOfSize(20.0)
let text = "T"
// 上記で用意したfontを利用した場合のテキストのサイズを取得
var attributes = [NSObject: AnyObject]()
attributes[NSFontAttributeName] = font
let size = text.sizeWithAttributes(attributes)
// テキストのサイズから表示するframeを作成