Skip to content

Instantly share code, notes, and snippets.

@chuganzy
chuganzy / APIKit+Rx.swift
Last active April 24, 2017 10:05
RxSwift x APIKit
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):
@azu
azu / js.md
Last active June 23, 2024 17:38
JavaScriptのレベル別書籍のまとめ

前提: 完成していて、比較的支持を集めていて、JavaScriptを中心にした書籍 (DOM APIよりは言語を中心とした内容)

追記: JavaScriptの入門書 #jsprimerを書いている

最初からES2015で学ぶことを前提にした初心者〜中級者向けのJavaScript本がなかったので書いてる。 ES2015でJavaScriptという言語のコア部分は大きく変わったので、それを前提とした内容にする予定。

@Pretz
Pretz / uiviewcontroller-playground.swift
Created December 8, 2015 23:37
UIViewController Playground: because getting a UIViewController/UINavigationController to display properly in a playground is a little non-obvious
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)
@firefightingcode
firefightingcode / UILabel+Spacing.swift
Created November 26, 2015 15:02
An extension for UILabel to set text with specific kerning, line spacing or line height multiple
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))
@manishkpr
manishkpr / AppDelegate.swift
Created August 26, 2015 01:20
iOS-Swift Open AlertView Dialog From AppDelegate (UIApplicationDelegate)
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.
@munisystem
munisystem / keymap.cson
Created August 7, 2015 07:08
atom editor keyconfig
'.editor':
'ctrl-n': 'native!'
'ctrl-p': 'native!'
'ctrl-n': 'core:move-down'
'ctrl-p': 'core:move-up'
@mizchi
mizchi / フロントエンドを楽にするために.md
Last active September 23, 2024 05:05
フロントエンドを楽にするために

フロントエンドを楽にするために

Qiitaを支えたい技術 at 時雨祭

About

  • HN: mizchi
  • Qiitaの方からきました(入社半年たったらしい)
  • Reactオジサンはそろそろ飽きてきた
  • Angularに興味が無いのでこっちにきた
@goxofy
goxofy / Karabiner_Private_For_Filco_Minila.xml
Last active April 23, 2024 09:19
Karabiner 备份 For Filco Minila
<?xml version="1.0"?>
<root>
<!-- 设备定义 -->
<devicevendordef>
<vendorname>FILCO</vendorname>
<vendorid>0x0a5c</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>MINILA_KEYBOARD</productname>
@klaaspieter
klaaspieter / tap.playground
Last active March 28, 2017 02:59
Ruby's tap method in a Swift playground (original blog post: http://www.annema.me/blog/post/edit/rubys-tap-method-in-swift)
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]
@henrik
henrik / yosemite_upgrade_notes.md
Last active December 30, 2015 02:29
Yosemite upgrade notes

Yosemite upgrade notes

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.

  1. Did a full-disk backup that I can restore from
  2. Moved out /usr/local to avoid super slow install, per option 1 in https://jimlindley.com/blog/yosemite-upgrade-homebrew-tips/: sudo mv /usr/local ~/local
  3. Upgraded to Yosemite
  4. Restored /usr/local, per option 1 in https://jimlindley.com/blog/yosemite-upgrade-homebrew-tips/: sudo mv ~/local /usr