Skip to content

Instantly share code, notes, and snippets.

View denielchiang's full-sized avatar
🕵️‍♂️
Working from home

Deniel Chiang denielchiang

🕵️‍♂️
Working from home
View GitHub Profile
@denielchiang
denielchiang / python_new project.md
Last active August 14, 2025 10:38
🐍 Python 新專案建立流程(macOS + asdf + direnv + uv)

Python Project Environment Setup Guide

This guide explains how to set up isolated Python environments for each project, using asdf for Python version management, direnv for automatic .venv activation, and 1Password CLI for secure secret handling.

📦 Prerequisites

brew install asdf direnv uv 1password/tap/1password-cli
op account add && op signin
@denielchiang
denielchiang / Relay.md
Last active August 5, 2025 15:52
Project Relay — MVP Specifica

Project Relay — MVP Specification

1. Overview

One-liner:
White‑label multi‑tenant chat hub that connects LINE & Discord messages into a unified Phoenix LiveView chatroom, with Slack‑style subdomain branding.

Primary Goal:
Allow companies to apply for an account, invite team members, connect LINE and Discord channels, and sync messages in real time.


@denielchiang
denielchiang / line.ex
Last active July 18, 2023 07:07
wrap_anonymous_function_in_parentheses
defmodule LineReminder.Line do
@moduledoc """
Line http client wrapper
"""
import OK, only: [~>: 2]
@doc """
Send passing message to particular line group
## Examples
@denielchiang
denielchiang / line.ex
Created July 17, 2023 01:38
Tomasz's advice
defmodule LineReminder.Line do
@moduledoc """
Line http client wrapper
"""
@doc """
Send passing message to particular line group
## Examples
iex> send_to_group("abc")
@denielchiang
denielchiang / line.ex
Created July 14, 2023 04:11
helpers/line.ex - first version
@spec send_to_group(String.t()) :: {:ok, String.t()} | {:error, String.t()}
def send_to_group(msg) do
Req.new(url: "https://notify-api.line.me/api/notify",)
|> Req.Request.put_header("Content-Type", "application/x-www-form-urlencoded")
|> Req.post(
auth: {:bearer, Application.fetch_env!(:line_reminder, :line_token)},
form: [message: msg]
)
|> case do
{:ok, %Req.Response{status: 200}} ->
@denielchiang
denielchiang / line.ex
Created July 14, 2023 04:09
helpers/line.ex
defmodule LineReminder.Line do
@moduledoc """
Line http client wrapper
"""
@spec init() :: Req.Request.t()
defp init() do
Req.new(
url: "https://notify-api.line.me/api/notify",
headers: [{"Content-Type", "application/x-www-form-urlencoded"}],
auth: {:bearer, Application.fetch_env!(:line_reminder, :line_token)}
<body>
<div>
<h2>前端技術</h2>
<h2>Vue</h2>
<h3>React</h3>
<h3>Angular</h3>
</div>
<div>
<h2>後端技術</h2>
<h3>Laravel</h3>
@denielchiang
denielchiang / subscription_ui_history.json
Created February 5, 2021 08:54
For GraphQL subscription testing
{
"key": "graphiql",
"lastId": 4,
"tabIds": [
"tab1",
"tab2",
"tab3",
"tab4"
],
"closedTabs": [],
@denielchiang
denielchiang / app.js
Created January 19, 2021 07:09 — forked from goofansu/app.js
LiveView upload directly to AWS China S3
let Uploaders = {}
Uploaders.S3 = function (entries, onViewError) {
entries.forEach(entry => {
let xhr = new XMLHttpRequest()
onViewError(() => xhr.abort())
xhr.onload = () => (xhr.status === 200 ? entry.done() : entry.error())
xhr.onerror = () => entry.error()
xhr.upload.addEventListener("progress", event => {
if (event.lengthComputable) {
    ~/Develops/elixir/batli  on   master ⇡1  df -h  ✔ 
Filesystem Size Used Avail Capacity iused ifree %iused Mounted on
/dev/disk2s5 957Gi 10Gi 299Gi 4% 488607 10034143193 0% /
devfs 194Ki 194Ki 0Bi 100% 670 0 100% /dev
/dev/disk2s1 957Gi 630Gi 299Gi 68% 2480872 10032150928 0% /System/Volumes/Data
/dev/disk2s4 957Gi 12Gi 299Gi 4% 13 10034631787 0% /private/var/vm
map auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /System/Volumes/Data/home
    ~/Develops/elixir/dockerize  on   4_deploy_dig…_with_docker  docker build -t dockerize:0.1.1 .  ✔ 
Sending build context to Docker daemon 42.78MB