Skip to content

Instantly share code, notes, and snippets.

@keisei1092
keisei1092 / 0_reuse_code.js
Created July 30, 2016 13:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
/* URLs starting with: http://qiita.com/ */
body, h1, h2, h3, h4, h5, h6 {
font-family: 'YuGothic' !important;
}
.itemsShowHeaderTitle_title {
font-family: 'GenEi LateMin' !important;
text-shadow: 0px 0px 3px black;
}
.draftsPreviewContent_title {
import UIKit
/*
A controller object that manages a simple model -- a collection of month names.
The controller serves as the data source for the page view controller; it therefore implements pageViewController:viewControllerBeforeViewController: and pageViewController:viewControllerAfterViewController:.
It also implements a custom method, viewControllerAtIndex: which is useful in the implementation of the data source methods, and in the initial configuration of the application.
There is no need to actually create view controllers for each page in advance -- indeed doing so incurs unnecessary overhead. Given the data model, these methods create, configure, and return a new view controller on demand.
*/

コード進行について

  • 終止
    • 全終止
      • V Iと進行して展開がいったん落ち着くこと
      • コードの進みを落ち着かせるのに最もスタンダードな方法
    • 偽終止
      • VからIではなくIの代理コードに終止すること
      • Iが来るだろうというところに裏切りを与える効果がある
  • 適切に配置することで、単調だったコード進行に表情をつけることができ、ドラマを演出させるのにもうってつけ

In your shell,

$ mkdir doujin-circle-scrape
$ cd doujin-circle-scrape
$ bundle init
$ emacs Gemfile

In Gemfile, add following to end

@keisei1092
keisei1092 / playground-snippet.swift
Last active November 17, 2016 03:22
PlaygroundでパッとViewだすやつ
//: Playground - noun: a place where people can play
import UIKit
import PlaygroundSupport
let viewController = UIViewController()
viewController.view.backgroundColor = UIColor.white
let navigationController = UINavigationController(rootViewController: viewController)
navigationController.view.frame = CGRect(x: 0, y: 0, width: 320, height: 569)

NO Alamofire BUT URLSession

Alamofire、AlamofireObjectMapperおよびAlamofireImageは、依存性を増やしたり、融通がきかなくなるため使いません。
その代わりSwiftビルトインのクラスURLSessionを使います。(参考:

Examples

enum JSONError: String, ErrorType {
    case NoData = "ERROR: no data"
@keisei1092
keisei1092 / RxSwiftMinimalImplementation.swift
Last active December 19, 2016 07:48
RxSwift最小実装
//
// ViewController.swift
// rxpractive
//
// Created by SaitoKeisei on 2016/12/19.
// Copyright © 2016 keisei_1092. All rights reserved.
//
import UIKit
import RxSwift
brew install youtube-dl
youtube-dl -x --audio-format mp3 <URL>