Update Heroku.

This commit is contained in:
Rico Sta. Cruz 2014-07-15 21:35:11 +08:00
parent 4cc053d6c3
commit 8087cc36f8
7 changed files with 255 additions and 87 deletions

View File

@ -9,18 +9,19 @@ layout: default
' ' ' ' ' ' ' ' '
<---------^------------^------------------^--------->
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

43
docker-osx.md Normal file
View File

@ -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/

View File

@ -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
@ -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
@ -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
@ -61,7 +65,7 @@ layout: default
heroku config:unset KEY1
## `apps` - Applications
### `apps` - Applications
heroku apps # list
heroku apps:create [NAME]
@ -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
@ -80,7 +89,7 @@ layout: default
heroku domains:clear
heroku domains:remove example.com
## DNS records
### DNS records
# Root domains
mydomain.com. (A)
@ -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:
@ -113,7 +122,7 @@ Create a `.htpasswd` file:
See https://gist.github.com/3316425
## References:
### References:
* https://addons.heroku.com/
* https://devcenter.heroku.com/

65
ios-provision.md Normal file
View File

@ -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
make-assets.md Normal file
View File

@ -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 ] $< > $@

View File

@ -5,24 +5,27 @@ layout: default
### Var assignment
JS_COMPRESSOR := $(uglify)
# Safe assignment
prefix ?= /usr/local
uglify = $(uglify) # assignment
compressor := $(uglify) # lazy assignment
prefix ?= /usr/local # safe assignment
### Magic variables
$^ -- dependencies
$@ -- the thing to be built
out.o: src.c src.h
$@ - "out.o" (target)
$< - "src.c" (first prerequisite)
$^ - "src.c src.h" (all prerequisites)
$@ -- Rule target
$% -- Target member name ('foo' in 'foo.c' for '%.c')
$^ -- Prerequisites (all, without duplication)
$+ -- Prerequisites (all, with duplication)
$? -- Prerequisites (new ones)
$| -- Prerequisites (order-only?)
$< -- Prerequisite (first)
$* -- Basename without extension of the target (?)
%.o: %.c
$% - target member name ("foo" in "foo.c")
also:
$+ - prerequisites (all, with duplication)
$? - prerequisites (new ones)
$| - prerequisites (order-only?)
$* - basename without extension of the target (?)
$(@D) - target directory
### Command prefixes
@ -30,51 +33,56 @@ layout: default
@ Don't print command
+ Run even if Make is in 'don't execute' mode
Examples:
build:
@echo "Building"
@echo "compiling"
-gcc $< $@
@echo "Construction complete"
-include .depend
### Cool stuff
gitdir ?= $(shell git --exec-path)
gitver ?= $(word 3,$(shell git --version))
### Find files
FILES = $(shell find images -name "*")
FILES = $(shell find test/*.js)
$(patsubst images/%, assets/%, $(shell find images -name "*"))
js_files := $(wildcard test/*.js)
all_files := $(shell find images -name "*")
### Substitutions
# Same
$(SOURCE:.cpp=.o)
$(patsubst %.cpp, %.c, $(SOURCES))
file = $(SOURCE:.cpp=.o) # foo.cpp => foo.o
outputs = $(files:src/%.coffee=lib/%.js)
outputs = $(patsubst %.c, %.o, $(wildcard *.c))
assets = $(patsubst images/%, assets/%, $(wildcard images/*))
### More functions
$(strip $(string_var))
$(filter %.less, $(files))
$(filter-out %.less, $(files))
### Executing
JS_COMPRESSOR := $(uglify)
docs:
$(JS_COMPRESSOR) file.js
### Building files
%.o: %.c
ffmpeg -i $< > $@ # Input and output
foo $^
### Inclusion
### Includes
include assets.make
-include foo.make
### Options
make
-e, --environment-overrides
-B, --always-make
-s, --silent
-j, --jobs=N # parallel processing
### Conditionals
foo: $(objects)
ifeq ($(CC),gcc)
$(CC) -o foo $(objects) $(libs_for_gcc)
else
$(CC) -o foo $(objects) $(normal_libs)
endif

View File

@ -12,10 +12,15 @@ layout: default
"author": "Rico Sta. Cruz <hi@ricostacruz.com>",
"version": "0.1.0",
"engines": {"node": ">=0.8.0"},
"main": "index",
"bin": {
"command": "./bin/command"
},
"repository": {
"type": "git",
"url": "https://github.com/rstacruz/___.git"
},
"license": "MIT"
}
### Dependencies
@ -24,40 +29,29 @@ layout: default
"colors" : "*",
"flatiron" : "0.1.x",
"flatiron" : "~0.1.0",
"plates" : "https://github.com/:user/:project/tarball/:branch",
"plates" : "https://github.com/user/project/tarball/branch",
"stuff" : "git://github.com/user/project.git#commit-ish"
},
"devDependencies": { ... },
"devDependencies": {
...
},
### Scripts
"scripts": {
"start": "node ./bin/xxx", /* npm start */
"test": "vows --spec --isolate", /* npm test */
"postinstall": "...",
"prepublish": "grunt build", /* after 'npm install' and before 'npm
publish' */
}
### Git
"repository": {
"type": "git",
"url": "https://github.com/nodejitsu/http-server.git"
},
### Main entry point
"main": "index",
"main": "./lib/http-server",
### Bin
"bin": {
"command": "./bin/command"
},
### Misc
"private": true,
"preferGlobal": true,
"license": "MIT"
"preferGlobal": true
[Reference](http://package.json.nodejitsu.com/) (Nodejitsu.com)
### References
* http://package.json.nodejitsu.com/
* `npm help package.json`