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 / version_history.md
Created July 16, 2024 07:28
MKDocs Customize CSS changing
序號 日期 版本 說明 修訂人員 審核人員
1 2024/07/12 v1.0 初版 Den Madeline/Nancy
@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
@denielchiang
denielchiang / webpack.config.js
Created March 22, 2020 10:07
Customize CKEditor
/**
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
'use strict';
/* eslint-env node */
const path = require( 'path' );