Update resolutions, git, etc.

This commit is contained in:
Rico Sta. Cruz 2014-09-11 22:25:43 +08:00
parent b123a1bada
commit 901184e5b8
4 changed files with 146 additions and 3 deletions

57
angularjs.md Normal file
View File

@ -0,0 +1,57 @@
---
title: Angular.js
layout: default
---
<html ng-app="nameApp">
### Lists (ng-repeat)
<ul ng-controller="MyListCtrl">
<li ng-repeat="phone in phones">
{{phone.name}}
</li>
### Model (ng-model)
<select ng-model="orderProp">
<option value="name">Alphabetical</option>
<option value="age">Newest</option>
</select>
### Defining a module
App = angular.module('myApp', []);
App.controller('MyListCtrl', function ($scope) {
$scope.phones = [ ... ];
});
### Controller with protection from minification
App.controller('Name', [
'$scope',
'$http',
function ($scope, $http) {
}
]);
a.c 'name', [
'$scope'
'$http'
($scope, $http) ->
]
### HTTP
App.controller('PhoneListCtrl', function ($scope, $http) {
$http.get('/data.json').success(function (data) {
$scope.phones = data;
})
});
References:
* https://github.com/angular/angular-seed
* https://angularjs.org/

24
git-branch.md Normal file
View File

@ -0,0 +1,24 @@
---
title: Git branches
layout: default
---
# create a new branch
git checkout -b $branchname
git push origin $branchname --set-upstream
# get a remote branch
git fetch origin
git checkout --track origin/$branchname
# delete local remote-tracking branches (lol)
git remote prune origin
# list merged branches
git branch -a --merged
# delete remote branch
git push origin :$branchname
# get current sha1 (?)
git show-ref HEAD -s

48
git.md
View File

@ -1,8 +1,33 @@
--- ---
title: Git title: Git tricks
layout: default layout: default
--- ---
## Refs
HEAD^ # 1 commit before head
HEAD^^ # 2 commits before head
HEAD~5 # 5 commits before head
## Branches
# create a new branch
git checkout -b $branchname
git push origin $branchname --set-upstream
# get a remote branch
git fetch origin
git checkout --track origin/$branchname
# delete local remote-tracking branches (lol)
git remote prune origin
# list merged branches
git branch -a --merged
# delete remote branch
git push origin :$branchname
## Submodules ## Submodules
# Import .gitmodules # Import .gitmodules
@ -18,3 +43,24 @@ layout: default
## Cherry pick ## Cherry pick
git rebase 76acada^ git rebase 76acada^
## Misc
# get current sha1 (?)
git show-ref HEAD -s
# show single commit info
git log -1 f5a960b5
## Short log
$ git shortlog
$ git shortlog HEAD~20.. # last 20 commits
James Dean (1):
Commit here
Commit there
Frank Sinatra (5):
Another commit
This other commit

View File

@ -3,5 +3,21 @@ title: Resolutions
layout: default layout: default
--- ---
* iPhone 4S: 640 x 960 (320 x 480) ### Phones
* iPhone 5: 640 x 1136 (320 x 568)
| Resolution | DPPX | Actual resolution | PPI | Actual PPI | Size | Devices |
| --- | --- | --- | --- | --- | --- | --- |
| 320 x 480 | @1x | 320 x 480 | 163 ppi | 163 ppi | 3.5" | iPhone 3GS |
| 320 x 480 | @2x | 640 x 960 | 163 ppi | 326 ppi | 3.5" | iPhone 4S |
| 320 x 568 | @2x | 640 x 1136 | 163 ppi | 326 ppi | 4" | iPhone 5 |
| 375 x 667 | @2x | 750 x 1334 | 163 ppi | 326 ppi | 4.7" | iPhone 6 |
| 414 x 736 | @3x | 828 x 2208 | 133 ppi | 401 ppi | 5.5" | iPhone 6+ |
| --- | --- | --- | ---- | --- | --- | --- |
| 360 x 640 | @3x | 1080 x 1920 | 147 ppi | 441 ppi | 5" | Galaxy S4 |
### Tablets
| Resolution | DPPX | Actual resolution | PPI | Actual PPI | Size | Devices |
| --- | ---- | --- | --- | --- | ---- | --- |
| 1024 x 768 | @2x | 2048 x 1536 | 163 ppi | 326 ppi | 7.9" | iPad Mini Retina |
| 1024 x 768 | @2x | 2048 x 1536 | 132 ppi | 264 ppi | 9.7" | iPad Air |