Skip to content

Instantly share code, notes, and snippets.

@lborgav
lborgav / angularjs-providers-explained.md
Created November 19, 2015 05:10 — forked from demisx/angularjs-providers-explained.md
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
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

Constant

@lborgav
lborgav / index.html
Created October 9, 2015 19:03 — forked from chuyik/index.html
AngularJS simple implementation
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
Input: <input type="text" ng-model="hello"><br>
@lborgav
lborgav / resetAllSimulators.sh
Created September 29, 2015 04:28 — forked from ZevEisenberg/resetAllSimulators.sh
Reset all iOS simulators with this one weird trick
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 "{}"
@lborgav
lborgav / CustomTextField.swift
Last active August 31, 2015 06:06 — forked from appyaaron/CustomTextField.swift
A custom UITextField that allows you to easily set the placeholder color from your storyboard!
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]);
}
@lborgav
lborgav / gist:aad8b94c65a819c167fe
Last active August 28, 2015 07:11 — forked from Katafalkas/gist:eb5e840df1ace981c359
Swift UITableViewCell custom subclass simple Chat Bubble
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()
@lborgav
lborgav / SwiftTable
Last active August 28, 2015 07:02 — forked from jquave/SwiftTable
Example code for Table View in Swift
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() {
@lborgav
lborgav / tmux_cheatsheet.markdown
Last active August 29, 2015 14:27 — forked from henrik/tmux_cheatsheet.markdown
tmux cheatsheet

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@lborgav
lborgav / yosemite ntfs read+write.txt
Last active August 29, 2015 14:26 — forked from bjorgvino/yosemite ntfs read+write.txt
osxfuse + ntfs-3g + Yosemite = NTFS R/W
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
@lborgav
lborgav / index.html
Last active August 29, 2015 14:25 — forked from mckennatim/index.html
<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">

CI with Travis, GitHub Releases API and gh-pages

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.

Organize your project

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.