Skip to content

Instantly share code, notes, and snippets.

View hieuphq's full-sized avatar

Phan Quang Hieu hieuphq

  • Dwarves Foundation
  • Vietnam
View GitHub Profile
@hieuphq
hieuphq / History|-115caab2|entries.json
Created September 26, 2022 16:34
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///Users/hieuphan/workspace/open-fabric/slice-master-service/src/services/widget/service.ts","entries":[{"id":"MYpb.ts","timestamp":1651212462126},{"id":"FsGA.ts","timestamp":1651212490696},{"id":"HYAo.ts","timestamp":1651212502901},{"id":"2Hwn.ts","timestamp":1651212602683},{"id":"nCMb.ts","timestamp":1651212627603},{"id":"m5D0.ts","timestamp":1651215000947},{"id":"chsR.ts","timestamp":1651215406143},{"id":"C8Sa.ts","timestamp":1651215424855},{"id":"dFRx.ts","timestamp":1651215451052},{"id":"hXGX.ts","timestamp":1651215569289},{"id":"g8fN.ts","timestamp":1651215585440},{"id":"vyNp.ts","timestamp":1651215654505},{"id":"dOSp.ts","timestamp":1651215985111},{"id":"Qu8b.ts","timestamp":1651216036581},{"id":"eMHY.ts","source":"moved.source","timestamp":1651216105799},{"id":"NkSa.ts","timestamp":1651216267392},{"id":"puHu.ts","timestamp":1651223580452},{"id":"8CbQ.ts","timestamp":1651230120738},{"id":"ulKG.ts","timestamp":1651231549212},{"id":"95Gm.ts","timestamp":1651231600190},{"id":
@hieuphq
hieuphq / ets_caching
Last active July 1, 2021 03:37
Scenarios using concurrency in elixir
defmodule EtsCacheExample do
def init!(seed, table_name) when is_atom(table_name) do
case :ets.info(table_name) do
:undefined ->
:ets.new(table_name, [:set, :public, :named_table])
_ ->
raise "ETS table with name #{table_name(pool_name)} already exists."
end
@hieuphq
hieuphq / FRP iOS Learning resources.md
Created September 16, 2020 06:50 — forked from JaviLorbada/FRP iOS Learning resources.md
The best FRP iOS resources.

Videos

import Foundation
open class EventBus {
struct Static {
static let instance = EventBus()
static let queue = DispatchQueue(label: "EventBus", attributes: [])
}
@hieuphq
hieuphq / gist:e7dd1a8bc9a07bfd53257db3cb8a211a
Created December 6, 2019 03:05
Deploying a Static HTML Site with Docker and Nginx
#### Build a directory for the website
- For front-end dev who using static files to host your web.
As usually, when you work with react lib, you use bundler(webpack, parcel, browser) to compile your project, you'll get a folder with static file.
What next will we do with those thing? Is it run stand alone locally by open index.html?
Nope, some reason for that is reference files in html follow format '/xxx.js'.It's an absolute path point to:
- public folder for php server
- uri
It should be './xxx.js'
So, you can use dockerfile to build an image with static files. You make a container to run that image.
Finally, you map a machine port to port 80 and enjoy your product at locally
Name: Flash
Serial: eNrzzU/OLi0odswsqnHLSSzOqDGoca7JKCkpsNLXLy8v1ytJTczVLUotKNFLzs8FAJHYETc=
if anyone wants to thank ETH: 0x527c2aB55b744D6167dc981576318af96ed26676
Thank you!
{"lastUpload":"2020-01-08T03:49:39.595Z","extensionVersion":"v3.4.3"}

Keybase proof

I hereby claim:

  • I am hieuphq on github.
  • I am hieutieutu (https://keybase.io/hieutieutu) on keybase.
  • I have a public key ASC7GkLEFU73-M4MDi1zCTIAvHf7pIqEJO9VJ8_IZ5RxTgo

To claim this, I am signing this object:

@hieuphq
hieuphq / SynchronizedValue.swift
Created May 4, 2019 13:44
This template class make a value can be safe thread
/**
* Copyright (c) 2017 Razeware LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*