In React's terminology, there are five core types that are important to distinguish:
React Elements
In React's terminology, there are five core types that are important to distinguish:
React Elements
| // *** Extensions | |
| extension NSString { | |
| func dictionaryFromJson() -> NSDictionary { | |
| let jsonData = self.dataUsingEncoding( NSUTF8StringEncoding )! | |
| return jsonData.dictionary() | |
| } | |
| } | |
| extension String { | |
| func dictionaryFromJson() -> NSDictionary { | |
| let jsonData = self.dataUsingEncoding( NSUTF8StringEncoding )! |
| /** | |
| * VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units | |
| * | |
| * To overcome this, create media queries that target the width, height, and orientation of iOS devices. | |
| * It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing | |
| * the height of element `.foo` —which is a full width and height cover image. | |
| * | |
| * iOS Resolution Quick Reference: http://www.iosres.com/ | |
| */ | |
| var PostsApi = require('webapi/posts'), | |
| // assuming the api object from the jsbin snippet | |
| Reflux = require('reflux'); | |
| var PostActions = createActions(["load", "loadError"]); | |
| // load action is invoked either from: | |
| // * top most component's componentDidMount | |
| // function in your application, or | |
| // * window.onLoad | |
| // I prefer the first strategy because that'll |
| import UIKit | |
| import Security | |
| let serviceIdentifier = "com.company" | |
| let accessGroup = "com.company.app" | |
| let kSecClassValue = kSecClass as NSString | |
| let kSecAttrAccountValue = kSecAttrAccount as NSString | |
| let kSecValueDataValue = kSecValueData as NSString | |
| let kSecClassGenericPasswordValue = kSecClassGenericPassword as NSString |
| // | |
| // API.swift | |
| // | |
| // Created by Taro Minowa on 6/10/14. | |
| // Copyright (c) 2014 Higepon Taro Minowa. All rights reserved. | |
| // | |
| import Foundation | |
| typealias JSONDictionary = Dictionary<String, AnyObject> |
| # Sublime Text 3 languages list: | |
| ls -1 /Applications/Sublime\ Text.app/Contents/MacOS/Packages/ | |
| # Remove all default Sublime Text 3 snippets for Python language | |
| export ST3_LANG="Python" | |
| mkdir -p ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/$ST3_LANG/ | |
| unzip -l /Applications/Sublime\ Text.app/Contents/MacOS/Packages/$ST3_LANG.sublime-package | grep '.sublime-snippet' | awk '{print $4}' | while read f; do touch ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/$ST3_LANG/$f; done | |
| unset ST3_LANG |
| #!/bin/sh | |
| npm install |
| *Add the toolchain/test PPA* | |
| sudo add-apt-repository ppa:ubuntu-toolchain-r/test | |
| sudo apt-get update | |
| sudo apt-get install g++-4.8 | |
| sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50 | |
| *If you ever want to update symlinks for a future version:* | |
| sudo rm /usr/bin/g++ | |
| sudo ln -s /usr/bin/g++-4.XXX /usr/bin/g++ |