前提: 完成していて、比較的支持を集めていて、JavaScriptを中心にした書籍 (DOM APIよりは言語を中心とした内容)
追記: JavaScriptの入門書 #jsprimerを書いている
最初からES2015で学ぶことを前提にした初心者〜中級者向けのJavaScript本がなかったので書いてる。 ES2015でJavaScriptという言語のコア部分は大きく変わったので、それを前提とした内容にする予定。
import Foundation | |
import APIKit | |
import RxSwift | |
extension Session { | |
func rx_sendRequest<T: RequestType>(request: T) -> Observable<T.Response> { | |
return Observable.create { observer in | |
let task = self.sendRequest(request) { result in | |
switch result { | |
case .Success(let res): |
前提: 完成していて、比較的支持を集めていて、JavaScriptを中心にした書籍 (DOM APIよりは言語を中心とした内容)
追記: JavaScriptの入門書 #jsprimerを書いている
最初からES2015で学ぶことを前提にした初心者〜中級者向けのJavaScript本がなかったので書いてる。 ES2015でJavaScriptという言語のコア部分は大きく変わったので、それを前提とした内容にする予定。
import UIKit | |
let vc = UIViewController() | |
vc.view.backgroundColor = .whiteColor() | |
vc.navigationItem.title = "This is a view controller" | |
let searchController = UISearchController(searchResultsController: nil) | |
//searchController.searchBar.barTintColor = UIColor(red:0.16, green:0.45, blue:0.72, alpha:1) |
import UIKit | |
extension UILabel { | |
func setText(text: String, withKerning kerning: Double) { | |
self.attributedText = NSAttributedString(string: text, attributes: kerningAttribute(kerning)) | |
} | |
func setText(text: String, withLineSpacing lineSpacing: CGFloat) { | |
self.attributedText = NSAttributedString(string: text, attributes: lineSpacingAttribute(lineSpacing)) |
import UIKit | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
var window: UIWindow? | |
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { | |
// Override point for customization after application launch. |
'.editor': | |
'ctrl-n': 'native!' | |
'ctrl-p': 'native!' | |
'ctrl-n': 'core:move-down' | |
'ctrl-p': 'core:move-up' |
<?xml version="1.0"?> | |
<root> | |
<!-- 设备定义 --> | |
<devicevendordef> | |
<vendorname>FILCO</vendorname> | |
<vendorid>0x0a5c</vendorid> | |
</devicevendordef> | |
<deviceproductdef> | |
<productname>MINILA_KEYBOARD</productname> |
import Foundation | |
/*: | |
Ruby has a nice method called `tap`, which I wanted to try and port to Swift. To learn what it does, let’s take a look at [Ruby’s documentation](http://ruby-doc.org/core-2.2.0/Object.html#method-i-tap): | |
> Yields self to the block, and then returns self. The primary purpose of this method is to “tap into” a method chain, in order to perform operations on intermediate results within the chain. | |
Yeah, right. I don’t really know what that means. Googling yields (no pun intended) many contrived examples like these: | |
[1, 2, 3, 4].tap &:reverse! # [4, 3, 2, 1] |
From a (mostly) Ruby on Rails developer.
After doing the below everything seems to work (some of it worked before doing anything), including Ruby, Gems, RVM, Homebrew, VirtualBox/Vagrant VMs, Pow, tmux, git, vim.
/usr/local
to avoid super slow install, per option 1 in https://jimlindley.com/blog/yosemite-upgrade-homebrew-tips/: sudo mv /usr/local ~/local
/usr/local
, per option 1 in https://jimlindley.com/blog/yosemite-upgrade-homebrew-tips/: sudo mv ~/local /usr