Skip to content

Commit

Permalink
Update Heroku.
Browse files Browse the repository at this point in the history
  • Loading branch information
rstacruz committed Jul 22, 2014
1 parent 4cc053d commit 8087cc3
Show file tree
Hide file tree
Showing 7 changed files with 255 additions and 87 deletions.
15 changes: 8 additions & 7 deletions bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@ layout: default
768 992 1200
' ' ' ' ' ' ' ' '
<---------^------------^------------------^--------->
xs sm md lg
xs sm md lg
(phone) (tablet) (laptop) (desktop)

Min:

@media (min-width: @screen-sm-min) /* small >= 768px tablet */
@media (min-width: @screen-md-min) /* medium >= 992px desktop */
@media (min-width: @screen-lg-min) /* large >= 1200px big desktop */
@media (min-width: @screen-sm-min) { /* >= 768px (small tablet) */
@media (min-width: @screen-md-min) { /* >= 992px (medium laptop) */
@media (min-width: @screen-lg-min) { /* >= 1200px (large desktop) */

Max:

@media (max-width: @screen-xs-max) /* xsmall < 768px phone */
@media (max-width: @screen-sm-max) /* smalll < 992px tablet */
@media (max-width: @screen-md-max) /* medium < 1200px desktop */
@media (max-width: @screen-xs-max) { /* < 768px (xsmall phone) */
@media (max-width: @screen-sm-max) { /* < 992px (small tablet) */
@media (max-width: @screen-md-max) { /* < 1200px (medium laptop) */

### Columns

Expand Down
43 changes: 43 additions & 0 deletions docker-osx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: Docker on OSX
layout: default
---

You'll need these:

* [boot2docker] - bootstraps a Virtualbox VM to run a docker daemon
* [docker] - docker client

### Install

$ brew install boot2docker
$ brew install docker
$ boot2docker init

### Turning on

$ boot2docker up

Waiting for VM to be started...... Started.
To connect the Docker client to the Docker daemon, please set:

export DOCKER_HOST=tcp://192.168.59.103:2375

$ export DOCKER_HOST=tcp://192.168.59.103:2375

### Try it

$ docker search ubuntu

$ docker pull ubuntu
$ docker start ubuntu

### Turning off

$ boot2docker save
# save state to disk

### Vagrant

[boot2docker]: https://github.com/boot2docker/boot2docker
[docker]: https://www.docker.com/
37 changes: 23 additions & 14 deletions heroku.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ title: Heroku
layout: default
---

## `create` - Create an app
### `create` - Create an app

heroku create sushi

## `sharing` - Collaboration
### `sharing` - Collaboration

# Manage collaborators
heroku sharing # List
Expand All @@ -17,19 +17,19 @@ layout: default
# Transfer to another owner
heroku sharing:transfer new@owner.com

## `logs` - Show logs
### `logs` - Show logs

heroku logs
heroku logs -t # --tail (stream)
heroku logs -s app # --source (only on app logs)

## `releases`
### `releases`

heroku releases
heroku releases:info v25
heroku rollback

## `pg` - Postgresql
### `pg` - Postgresql

# Start a database
heroku addons:add heroku-postgresql
Expand All @@ -38,18 +38,22 @@ layout: default
# Enable backups
heroku addons:add pgbackups:auto-month

## `ps` - Managing processes
### `ps` - Managing processes

heroku ps # list
heroku ps:scale web=1 # spawn more dynos

## `run` - Running
### `restart`

heroku restart

### `run` - Running

heroku run bash
heroku run console # Rails console
heroku run rake assets:precompile

## `config` - Environment var configuration
### `config` - Environment var configuration

heroku config # List
heroku config -s # List in shell format
Expand All @@ -61,7 +65,7 @@ layout: default

heroku config:unset KEY1

## `apps` - Applications
### `apps` - Applications

heroku apps # list
heroku apps:create [NAME]
Expand All @@ -70,7 +74,12 @@ layout: default
heroku apps:open # open in browser
heroku apps:rename NEWNAME

## `domains` - Custom domains
### `maintenance`

heroku maintenance:on
heroku maintenance:off

### `domains` - Custom domains

# Add both!
heroku domains:add example.com
Expand All @@ -80,7 +89,7 @@ layout: default
heroku domains:clear
heroku domains:remove example.com

## DNS records
### DNS records

# Root domains
mydomain.com. (A)
Expand All @@ -92,13 +101,13 @@ layout: default
.mydomain.com. (CNAME)
=> proxy.heroku.com

## Wildcard domains
### Wildcard domains

heroku addons:add wildcard_domains

*.yourdomain.com => heroku.com

## htpasswd (for PHP apps)
### htpasswd (for PHP apps)

Create an `.htaccess` file in the webroot:

Expand All @@ -113,7 +122,7 @@ Create a `.htpasswd` file:

See https://gist.github.com/3316425

## References:
### References:

* https://addons.heroku.com/
* https://devcenter.heroku.com/
Expand Down
65 changes: 65 additions & 0 deletions ios-provision.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
title: iOS Provisioning Profiles
layout: default
---

### Types of profiles

* __Development__ - deploy to an iPhone via XCode
* __Adhoc__ - deploy via testflightapp.com
* __Appstore__ - only used for submitting to the app store

### Requirements

| What | Dev | Adhoc | Appstore |
|-----------------|-----|-------|----------|
| CSR file | |||
| Device UDIDs ||| |
| Developers list || | |

### Obtaining a CSR file

Needed for Adhoc & Appstore builds.

* Open *Keychain Access.app*
* *Keychain Access* menu -> *Certificate Assistant* menu -> *Request a
certificate...*
* User email address is *your email*
* Common name is *your name*
* CA Email address is *blank*
* Request is *Saved to disk*

### Get the `.cer` files

Needed for Adhoc & Appstore builds.

* in the iOS dev portal, go to *Certificates*, and download the certificate.
Install it on the dev machine.

### Obtaining device UDIDs

Needed for Dev and Adhoc builds.

* via iTunes: http://whatsmyudid.com
* via XCode: cmd+shift+2 (Organizer), Devices

For developers
--------------

Don't ever ask Xcode to *Fix issue...* for you.

### Using a provisioning profile

No need to use `.mobileprovision` files since XCode 5.

* Open the `*.mobileprovision` file using Finder
* XCode Project -> *Build settings* tab -> *Code signing* section ->
*Provisioning Profile* section
* Set *Debug* to the *development* profile
* Set *Release* to the *ad-hoc* profile

### Building an .ipa (Adhoc or Appstore)

* In the toolbar, select "iOS Device" as the target
* *Product* menu -> *Archive*
* In the Organizer (Cmd+Shift+2) -> *Archives* tab -> *Distribute...* button
48 changes: 48 additions & 0 deletions make-assets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: Make for assets
layout: default
---

### Basic compiling

bin := ./node_modules/.bin

all: build/foo.js

build/%.js: src/%.coffee
@$(bin)/coffee < $^ > $@

### Stylus + Autoprefixer

bin := ./node_modules/.bin
stylus := $(bin)/stylus
autoprefixer := $(bin)/autoprefixer
styl_files := $(shell find web/ -name "*.styl")

all: public/app.css

public/app.css: css/app.styl

%.css: %.styl $(styl_files)
@$(stylus) $< | $(autoprefixer) -b "> 1%" > $@

### Hint

hint:
$(js_files)

### Watching

watch:
@echo "... watching for changes"
@while true; do make -s; sleep 1; done

### Browserify

js_files := $(shell find web/ -name "*.js")

public/app.js: web/app.js
public/vendor.js: web/vendor.js

public/%.js: web/%.js $(js_files)
$(browserify) -t [ cssify -x .css ] $< > $@
Loading

0 comments on commit 8087cc3

Please sign in to comment.