Skip to content

Instantly share code, notes, and snippets.

View laiyenju's full-sized avatar

Yen Lai laiyenju

View GitHub Profile
I am attesting that this GitHub handle laiyenju is linked to the Tezos account tz1bSdcNPUSruB5PY51J8LCSkjeXvttjyERU for tzprofiles
sig:edsigtfrPAoJvhtHKpumASsMRyced7US2fe4rJMX5p6SdqHPVAZKZWTnS7avQkUqCensbiC4BiHhjkJ24W9v77hnMs2DNr4tsg8
@laiyenju
laiyenju / condition.html
Created April 10, 2020 05:33
以條件式決定顯圖方式
# 整合成條件式
{% if page.feature_image %}
<meta property="og:image" content="{{ site.url }}/{{ page.feature_image }}">
{% else %}
<meta property="og:image" content="{{ site.url }}/{{ site.favicon }}">
{% endif %}
@laiyenju
laiyenju / default.html
Created April 9, 2020 06:12
Twitter Cards and Open Graph metadata
<head>
<!--OpenGraph with Twitter Card-->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@theYenLai">
{% if page.feature_image %}
<meta property="og:site_name" content="{{ site.title }}">
<meta property="og:title" content="{{ page.title }}">
<meta property="og:url" content="http://{{ site.url }}{{ site.baseurl }}{{ page.url }}">
<meta property="og:image" content="{{ site.url }}/{{ page.feature_image }}">
@laiyenju
laiyenju / exchange.py
Last active March 22, 2020 06:41
換鈔票,目標是以最大可換的紙鈔面額分組,顯示各組的數量與金額,以「;」分隔,但在字串結尾要刪除「;」
price = 1000 - int(input())
# 設定換各個面額鈔票的數量
num500 = price//500
num100 = (price - num500*500) // 100
num50 = (price - num500*500 - num100*100) // 50
num10 = (price - num500*500 - num100*100 - num50*50) // 10
num1 = (price - num500*500 - num100*100 - num50*50 - num10*10) // 1
# 當換鈔數量是 0 時,不顯示
[
{
"title": "Seductions of Place",
"Author": "Carolyn Cartier/ Alan A.Lew",
"publisher": "ROUTLEDGE. TAYLOR & FRANCIS GROUP",
"language": "英文",
"category_1": "外文書",
"category_2": "社科",
"year": 2001,
"month": 9,
title author publisher language category_1 category_2 year month translate
Seductions of Place Carolyn Cartier/ Alan A.Lew ROUTLEDGE. TAYLOR & FRANCIS GROUP 英文 外文書 社科 2001 9 T
零的故事 Charles Seife 商周出版 中文 中文書 科普 2001 9 T
怪才的荒誕與憂傷 Dave Eggers 遠見天下文化出版股份有限公司 中文 中文書 文學 2001 9 T
ORCHID FEVER Eric Hansen VINTAGE INTERNATIONAL 英文 外文書 人文 2001 9 T
給我一件新衣服 Frederique Bertrand 格林文化事業股份有限公司 中文 兒童 圖畫書 2001 10 T
ART MUSEUMS Gerhard Mack/ Harald Szeemann BIRKHAUSER 英文 外文書 建築 2001 10 T
古地圖集精選 Phillip Allen 貓頭鷹出版社 中文 中文書 人文 2001 10 T
浪遊之歌 Rebecca Solnit 麥田出版社 中文 中文書 人文 2001 10 T
BETWEEN FATHER AND SON V. S. Naipaul VINTAGE INTERNATIONAL 英文 外文書 文學 2001 10 T
@laiyenju
laiyenju / emotion_box.ino
Last active October 28, 2019 16:58
A shared file for Emotion Box project 👉https://github.com/laiyenju/EmotionBox
//引入資料庫
#include <HX711_ADC.h> //HX711 套件庫
#include <EEPROM.h>
#include <CuteBuzzerSounds.h> //提供給蜂鳴器採用的聲音庫,可以實現豐富的音效,卻能避開 delay 寫法
// 配合 CuteBuzzerSounds 資料庫的方式,將 Pin2 設定為蜂鳴器輸出口
#define BUZZER_PIN 2
//HX711 constructor (dout pin, sck pin):
HX711_ADC LoadCell(4, 5);

Keybase proof

I hereby claim:

  • I am laiyenju on github.
  • I am yenlai (https://keybase.io/yenlai) on keybase.
  • I have a public key ASDLtR-n5ppbmfISWmexgR1YG-tiOq1vSKLBwTuCP_JvPQo

To claim this, I am signing this object:

$(document).ready(()=>{ // jQuery main
let stage = new createjs.Stage(canvas);
let repo = new createjs.LoadQueue(); //建立預載資源
function setup() {
// automatically update
createjs.Ticker.on("tick", e => stage.update());
createjs.Ticker.framerate = 60;
@laiyenju
laiyenju / index.html
Last active July 8, 2017 11:47
網頁名片製作練習-TC1
<div class="namecard">
<div class="name">黃 紫婕
</div>
<div class="otherinfo">
T.C. HUANG
<br>+886 922 895 696
<br>tcmiss@gmail.com
</div>