Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Hoàng Hà halink0803

🎯
Focusing
Block or report user

Report or block halink0803

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View postgres procedure function.md
	CREATE OR REPLACE FUNCTION get_erc20_transfer(text, text, integer, integer) RETURNS text AS 
$$
DECLARE
query_final text;
wallet ALIAS FOR $1;
token ALIAS FOR $2;
from_time ALIAS FOR $3;
to_time ALIAS FOR $4;
BEGIN
@halink0803
halink0803 / fix_onedrive.sh
Created Nov 1, 2018 — forked from drblue/fix_onedrive.sh
Fix OneDrive for Mac CPU usage
View fix_onedrive.sh
#!/bin/bash
find ~/Library/Group\ Containers/ -type d -name OfficeFileCache -exec rm -r {} +
View wallet_fees_cq.sql
CREATE CONTINUOUS QUERY "wallet_fee" ON "trade_logs"
RESAMPLE EVERY 1h FOR 1d
BEGIN
SELECT SUM("amount") as "sum_amount"
INTO "hourly_wallet_fees"
FROM "wallet_fees"
GROUP BY "reserve_addr", "wallet_addr", time(1h)
END
CREATE CONTINUOUS QUERY "wallet_fee_1d" ON "trade_logs"
@halink0803
halink0803 / Clear Chrome synced data.md
Last active Oct 15, 2018
Clear Chrome synced data
View Clear Chrome synced data.md

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

View Get bolt buckets name list.md
err = db.View(func(tx *bolt.Tx) error {
        return tx.ForEach(func(name []byte, _ *bolt.Bucket) error {
            fmt.Println(string(name))
            return nil
        })
    })
View Twelve_Go_Best_Practices.md
@halink0803
halink0803 / docker-cleanup-resources.md
Last active Jan 16, 2018 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks
View docker-cleanup-resources.md

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
View Make file for go.md

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))
View really simple example go socket connect
https://jeremywho.com/simple-websocket-client-in-go-using-gorilla-websocket/
@halink0803
halink0803 / ConvertVie.js
Created Sep 12, 2017 — forked from hu2di/ConvertVie.js
JavaScript: Chuyển tiếng Việt có dấu sang không dấu
View ConvertVie.js
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");
You can’t perform that action at this time.