New syntax for css - Scss Sass

Sass

Installation

1
gem install sass

Usage

1
2
3
4
5
6
# Compile scss to css
sass input.scss output.css

sass --watch input.scss output.css

sass --watch src/sass:dist/css

Syntax

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// variable
$font-stack: Helvetica, sans-serif;
$font-color: #000;

body{
font: 100% $font-stack
color: $font-color;
}


// Mixins
@mixin border-radius($radius) {
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
-ms-border-radius: $radius;
border-radius: $radius;
}

.box { @include border-radius(10px); }

Reference

http://sass-lang.com/guide





Git Cheatsheet

Usage

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# git clone
git clone [github-repo-url]
git clone -l /path/to/git copy-to-destination

# git init
git init
git init --bare

# add or update your file(s) / folder(s)
git add .

# commit
git commit -m "your commit message"

# push your code to remote repo
git push

# pull your code from remote repo
git pull

branch

1
2
3
git branch
git reset
git checkout exist-branch

Chrome Console Cheatsheet

Web

Usage

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Show object or value
window.console

# Log the value
console.log('Hellow ' + str_world);
console.warn('yellow exquotation mark')
console.error('red cross error');

# Show object details
console.dir(window)

# Assertion
console.assert(true && fasle)

# Clear
console.clear()

# Table
console.table( [{col1: "00", col2: "01"}, {col1:"10", col2:"11"}] );

# Time
console.time('timeTag');
doSomething();
console.timeEnd('timeTag');

# Group
console.group('functionDebuging');
console.log('log');
console.groupEnd('functionDebuging');

Capture all of your http connection

Web

mitmproxy

Use and abuse of a hackable SSL-capable man-in-the-middle proxy. Command line friendly.

Server Installnation

1
2
3
4
5
6
# pull the image 
docker pull mitmproxy/mitmproxy

# ~/.mitmproxy locate your certs that you need to install to your client
# 8080 port
docker run --rm -it -v ~/.mitmproxy:/home/mitmproxy/.mitmproxy -p 8080:8080 mitmproxy/mitmproxy

Test through curl

1
2
3
4
5
6
7
# http connect to example
http_proxy=http://localhost:8080/ curl http://example.com/

# https connect to example
https_proxy=http://localhost:8080/ curl -k https://example.com/

# Go back to your docker console your will get the previous connections

iPHone Client Setup

http://jasdev.me/intercepting-ios-traffic (PLEASE FORGET YOUR NETWORK AND JOIN AGAIN WITH PROXY SETTING if you are using wifi)

Reference

https://github.com/mitmproxy/mitmproxy