Skip to content

Instantly share code, notes, and snippets.

View NSLog0's full-sized avatar
🦋

NSLog0 NSLog0

🦋
View GitHub Profile
iptables -A INPUT -s <ip-address> -p tcp --destination-port 27017 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -d <ip-address> -p tcp --source-port 27017 -m state --state ESTABLISHED -j ACCEPT
// สลับไป develop
git checkout develop
// merge branch ของเราเข้าไป
git merge –no-ff <name>
// เสร็จแล้วก็ลบทิ้ง
git branch -d <name>
// สร้าง branch จาก branch ที่เราอยู่ในัจจุบัน
git branch feature/<name>
// สลับไป branch สร้าง
git checkout feature/<name>
// เปลี่ยนไปอยู่ master ก่อน
git checkout master
// ทำการ merge โค้ดเข้าไปใน master
git merge --no-ff hotfix/create-post-error-0.2.1
// ติดเลขเวอร์ชั่นเพื่อเตือนความจำ
git tag -a 0.2.1
--------------------------------------------------
// ถ้าเราอยู่ใน master แล้วก็สั่ง
git checkout -b hotfix/create-post-error-0.2.1
// หรือถ้าอยู่ branch อื่นๆ ก็พิมพ์ตามคำสั่งด้านล่าง
git checkout -b hotfix/create-post-error-0.2.1 master
// เปลี่ยนไปอยู่ master ก่อน
git checkout master
// ทำการ merge โค้ดเข้าไปใน master
git merge --no-ff release/release-0.2
// ติดเลขเวอร์ชั่นเพื่อเตือนความจำ
git tag -a 0.2
--------------------------------------------------
// ถ้าเราอยู่ใน develop แล้วก็สั่ง
git checkout -b realease/release-0.2
// หรือถ้าอยู่ branch อื่นๆ ก็พิมพ์ตามคำสั่งด้านล่าง
git checkout -b realease/release-0.2 develop
// ถ้าเราอยู่ใน develop แล้วก็สั่ง
git checkout -b feature/hello-world
// หรือถ้าอยู่ branch อื่นๆ ก็พิมพ์ตามคำสั่งด้านล่าง
git checkout -b feature/hello-world develop
@NSLog0
NSLog0 / check_cluster_1
Last active May 25, 2018 11:00
on my blog
$ docker service ps mysite
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR
ad0lvaxnsbgcirz5botfle2k3 mysite.1 wordpress ubuntu-node01 Running Running 7 minutes ago
3w6vx7b5kbykgmnpl4n3xgz95 mysite.2 wordpress ubuntu-node02 Running Running less than a second ago
btjrw6f33rud9vh6wa4pinzhj mysite.3 wordpress ubuntu-node03 Running Preparing 28 seconds ago
ab1p9p075zvwlb3t1g5f1n8ww mysite.4 wordpress ubuntu-node04 Running Preparing 28 seconds ago
@NSLog0
NSLog0 / foo.js
Last active November 17, 2019 22:03
this binding
function foo() {
console.log( this.a );
}
var a = 2;
foo(); // 2