| Provider | Singleton | Instantiable | Configurable |
|---|---|---|---|
| Constant | Yes | No | No |
| Value | Yes | No | No |
| Service | Yes | No | No |
| Factory | Yes | Yes | No |
| Decorator | Yes | No? | No |
| Provider | Yes | Yes | Yes |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Document</title> | |
| </head> | |
| <body> | |
| Input: <input type="text" ng-model="hello"><br> |
| osascript -e 'tell application "iOS Simulator" to quit' | |
| xcrun simctl list devices | grep -v '^[-=]' | cut -d "(" -f2 | cut -d ")" -f1 | xargs -I {} xcrun simctl erase "{}" |
| import UIKit | |
| @IBDesignable class CustomTextField: UITextField { | |
| @IBInspectable var placeholderColor: UIColor = UIColor.lightGrayColor() { | |
| didSet { | |
| let canEditPlaceholderColor = self.respondsToSelector(Selector("setAttributedPlaceholder:")) | |
| if (canEditPlaceholderColor) { | |
| self.attributedPlaceholder = NSAttributedString(string: placeholder, attributes:[NSForegroundColorAttributeName: placeholderColor]); | |
| } |
| class Cell: UITableViewCell { | |
| override func drawRect(rect: CGRect) { | |
| var bubbleSpace = CGRectMake(20.0, self.bounds.origin.y, self.bounds.width - 20, self.bounds.height) | |
| let bubblePath1 = UIBezierPath(roundedRect: bubbleSpace, byRoundingCorners: .TopLeft | .TopRight | .BottomRight, cornerRadii: CGSize(width: 20.0, height: 20.0)) | |
| let bubblePath = UIBezierPath(roundedRect: bubbleSpace, cornerRadius: 20.0) | |
| UIColor.greenColor().setStroke() | |
| UIColor.greenColor().setFill() |
| import UIKit | |
| class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| // Do any additional setup after loading the view, typically from a nib. | |
| } | |
| override func didReceiveMemoryWarning() { |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| Remove osxfuse if installed via homebrew: | |
| > brew uninstall osxfuse | |
| Install osxfuse binary and choose to install the MacFUSE compatibility layer: | |
| http://sourceforge.net/projects/osxfuse/files/latest/download?source=files | |
| Reboot (optional but recommended by osxfuse) | |
| Install ntfs-3g via homebrew: | |
| > brew update && brew install ntfs-3g |
| <meta name="description" content="Checking online status in AngularJS app" /> | |
| <title>ng-online</title> | |
| <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> | |
| <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css"> | |
| <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.14/angular.min.js"></script> | |
| <script src="http://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.10.0/ui-bootstrap-tpls.min.js"></script> | |
| <script src="main.js"></script> | |
| <body ng-app="App"> | |
| <div ng-controller="AppController"> |
When hosting a project on GitHub, it's likely you'll want to use GitHub Pages to host a public web site with examples, instructions, etc. If you're not using a continuous integration service like Travis, keeping your gh-pages site up to date requires continuous wrangling.
The steps below outline how to use Travis CI with GitHub Releases and GitHub Pages to create a "1-button" deployment workflow. After testing and running a release build, Travis will upload your release assets to GitHub. It will also push a new version of your public facing site to GitHub Pages.
Let's assume you are hosting a JavaScript project that will offer a single JavaScript file as a release asset. It's likely you'll organize your files like this.