Blockchain fullstack structure - Part 1 - Introduction

Recently, I ogranized a template of my blockchain fullstack project, including a Hardhat Solidity, Golang backend, and React js frontend. Does it need golang backend? Actually, I’m not sure. But there is a post said:

Server:
Even though you have your smart contracts as backend, often times a Dapp will still have an additional traditional server running. Not always, but probably more often than you think.

So, I combined Harhat, Golang gin, and Next.js to my dApp-structure github repo, added some basic, simple interaction from Next.js to Blockchain, and from Golang to Blockchain.

Read More  

Hardhat - Solidity and NFT - Part 2 - Deploy contract and Mint NFT

我們上一篇已經設定好docker及hardhat專案,這一篇就從NFT開始。

Generate NFT metadata

先建立一個images資料夾後,把你想要的圖片放進去,並存成1, 2, 3….之類的檔名,然後用ipfs-car指令打包在一起。

找不到圖可以先用opensea doc裡的圖當練習

ipfs-car

接著到NFT Storage上傳images.car檔案就可以了。
image-car-upload

Read More  

Hardhat - Solidity and NFT - Part 1 - Prepare project

農曆年前結束了一個博弈業的案子,開啟了虛擬貨幣及區塊鏈的契機。年後,整個2月都在研究區塊鏈的各種應用,NFT、opensea、solidity、hardhat、ipfs、testnet,今天這篇文章來記錄一下我用Solidity / Hardhat上架NFT的過程,以免以後金魚腦忘光。

Prerequisite: Sign-up these services.

Init project

我是使用docker, docker-compose,所以先來看看我的初始專案架構及docker-compose.ymlDockerfile
Init project

docker-compose.yml

1
2
3
4
5
6
7
8
9
10
11
12
version: '3'

services:
hardhat:
build:
context: ./hardhat
dockerfile: Dockerfile.dev
volumes:
- ./hardhat:/app
- /app/node_modules
ports:
- 8545:8545

Read More  

Facebook Pixel and Facebook Conversions API

Recently I got a Trello ticket to add Facebook Pixel tracking code, and they gave me a token to use. As a frontend engineer on that project, it’s confusing to me, because the token is for Facebook Conversions API. The biggest difference between Facebook Conversions API and Facebook Pixel is Facebook conversions API is invoked on the server, and Facebook Pixel is on the client. Besides, Facebook Conversions API is to solve IOS 14 updates. Now, let me write the usage of Facebook Conversions API down.

Get Facebook Conversions API token.

pixel-home-page

Read More  

設定Google Analytics 4 / Google Tag Manager追蹤user id

這篇文章我決定用中文寫,主要原因是中文的資料太少,而且也很多不是Google Analytics 4 + Google Tag Manager (GA4+GTM) 的設定,所以我覺得用中文記錄一下,好讓大家要搜尋的可以搜得到。

在以前GA追蹤埋追蹤碼時,我們要紀錄的user_id經過規劃後會視情況放在category, action, label, value或複雜一點的custom dimensions裡,GA經過長時間的演進,再加上GTM的助攻,現在已經可以有各種變化、也有多種templates可以套用在網站及應用程式裡。

至於要怎麼做呢?首先一樣從GTM上方的管理 > 安裝 Google 代碼管理工具把追蹤程式碼塞到我們的網站上,然後回到GA4去取得評估ID

如果你只有通用型GA分析的話,也可以從管理 > Google Analytics (分析) 4 資源設定輔助程式開啟GA4追蹤功能

get-evaluation-id.jpg

Read More  

Ruby on Jets - AWS serverless framework for Ruby on Rails

Ruby on Rails (RoR) is my favorite web framework, and today I will share an AWS serverless framework of RoR: Ruby on Jets. I’m not an AWS expert and even have no AWS certifications, and besides, this is my first time to use AWS Lambda, API gateway, dynamodb, and other serverless services.

Preparation:

  1. Add aws_access_key_id and aws_secret_access_key to ~/.aws/credentials
  2. Docker / Docker-compose I use in this demo.

Let’s look at initial project structure:
project-structure.png

Read More  

[Side project] KinectV2 applications migrates to OpenPose

OpenPose
經過了三個多月的努力,終於完成了偵測器的轉換。
會有這次的side project是因為剛好看到OpenPose這套人體姿態辨識的AI函數庫,只要用單單一個RGB camera就可以偵測出人的動作,這讓我想到以前解決Asus xtion pro停產的問題,就是要轉換轉換Asus xtion到KinectV2。現在KinectV2雖已停產,但網路上還是可以透過各種管道買到KinectV2,我就想趁這機會把KinectV2轉換到OpenPose試試看,看未來是不是只要一個RGB camera,就不用再擔心KinectV2真的買不到的問題了。

OpenPose: CMU-Perceptual-Computing-Lab / openpose

Read More  

[TIL] New service sharing: Hex.tech

Podcast source: Hex: Data Project Sharing with Caitlin Colgrove and Barry McCardel

最近迷上聽podcast,裡面專門介紹新服務跟技術,同時可以練練聽力跟學習新知,既然學了乾脆把它寫成心得分享出來。今天來介紹一個新聽到的服務: Hex,在解決大數據專案資料共享的問題。

Hex screenshot

雖然我不是個資料工程師,但曾經使用過Python Jupyter Notebook,而且中間又經歷過換電腦,要重跑都得安裝一堆有的沒的,每次用起來都很不方便。但這次聽到這個服務也是讓我滿臉問號,Jupyter不是已經很多人用了?為什麼又有一個類似的服務出來?

Read More