Skip to content

Instantly share code, notes, and snippets.

View halink0803's full-sized avatar
🇻🇳
Busy running

Ha Link halink0803

🇻🇳
Busy running
View GitHub Profile
@halink0803
halink0803 / Clear Chrome synced data.md
Last active October 15, 2018 06:24
Clear Chrome synced data

From device

  1. Go to chrome://settings/people.
  2. Click turn off sync data.
  3. At the pop up, check into Clear bookmark, history, password and more from this device.
  4. Click turn off.

=> all your synced data will be cleared from the device.

From cloud

err = db.View(func(tx *bolt.Tx) error {
        return tx.ForEach(func(name []byte, _ *bolt.Bucket) error {
            fmt.Println(string(name))
            return nil
        })
    })
@halink0803
halink0803 / LearnPress Assignment.md
Last active March 16, 2018 18:34
[Outdated] LearnPress Assignment is an add-on which provide the assignment post type with its features to LearnPress LMS plugins.

###What is an Assignment?
Assignment is another type of quiz for testing student progress or underdstanding of a course. However, assignment is bigger, reuquire longer time and more effort to complete. As being define as above, assignment in LearnPress is a post which giving a task for student to complete, allow student to upload their files, then teacher can download these file, check and give student score.

###How to use Assignment in LearnPress?
In LearnPress, assignment is an add-on, if you want to use assignment feature, you have to install "LearnPress Assignment Add-on".
Assignment in menu

After install Assignment Add-on, you can see "Assignment" menu along with "Lesson" and "Quiz".
Just like quiz and lesson, there are two ways to create an assignment in LearnPress: "Quick add assignment" and "Add assignment"

@halink0803
halink0803 / Twelve_Go_Best_Practices.md
Created January 20, 2018 09:07 — forked from pzurek/Twelve_Go_Best_Practices.md
Twelve Go Best Practices
@halink0803
halink0803 / docker-cleanup-resources.md
Last active January 16, 2018 09:16 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

Save from post Makefile cho Go

SRC = $(wildcard *.go)
OUT = <tên-file-binary-muốn-build>

CC = go
go = $(shell which go 2> /dev/null)

ifeq (, $(go))
https://jeremywho.com/simple-websocket-client-in-go-using-gorilla-websocket/
@halink0803
halink0803 / ConvertVie.js
Created September 12, 2017 04:47 — forked from hu2di/ConvertVie.js
JavaScript: Chuyển tiếng Việt có dấu sang không dấu
function change_alias(alias) {
var str = alias;
str = str.toLowerCase();
str = str.replace(/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ/g,"a");
str = str.replace(/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ/g,"e");
str = str.replace(/ì|í|ị|ỉ|ĩ/g,"i");
str = str.replace(/ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ/g,"o");
str = str.replace(/ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ/g,"u");
str = str.replace(/ỳ|ý|ỵ|ỷ|ỹ/g,"y");
str = str.replace(/đ/g,"d");
  <select class="select2 select2-multiple" multiple="multiple" multiple data-placeholder="Tỉnh ...">
                                
    <option value="01">Thành phố Hà Nội</option>

    <option value="02">Tỉnh Hà Giang</option>

    <option value="04">Tỉnh Cao Bằng</option>

    <option value="06">Tỉnh Bắc Kạn</option>

###Mac "Home/End" keys binding

{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} },
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"} },
{ "keys": ["shift+end"], "command": "move_to", "args": {"to": "eol", "extend": true} },
{ "keys": ["shift+home"], "command": "move_to", "args": {"to": "bol", "extend": true } }

###Afterglow