Skip to content

Instantly share code, notes, and snippets.

View kong0107's full-sized avatar

Kong Kao kong0107

View GitHub Profile
@kong0107
kong0107 / Schema.org 的 Product 類別.md
Last active November 17, 2022 05:39
筆記: Schema.org 的 Product 類別

Schema.org 的 Product 類別

Product 的子類中,有幾個容易相混淆的:

  • IndividualProduct
  • ProductCollection
  • ProductGroup
  • ProductModel
  • SomeProducts

後面會追加一起談 categorykeywords

@kong0107
kong0107 / Microdata 筆記.md
Last active November 17, 2022 05:37
Microdata 筆記

Microdata 筆記

本文的字典均採 Schema.org ,測試均採 Google 的複合式搜尋結果測試

概念

  • 是為了 SEO ,讓各大搜尋引擎也能解析出網頁裡有哪些資料。
  • 跟 DOM 樹做結合,並用 HTML 標籤的屬性來宣告資料的範 (scope)、型態 (type)、屬性 (prop) 。
@kong0107
kong0107 / lineNotifyByService.php
Last active September 24, 2022 08:34
send message to user-specified chatroom even you are not in
<?php
/**
* 1. Run an HTTP server.
* 2. Add service to LINE Notify: https://notify-bot.line.me/my/services/
* 3. Tell users to request https://notify-bot.line.me/oauth/authorize?response_type=code&scope=notify&response_mode=form_post&client_id=xxxxxxxxxxxxxxxxxxxx&redirect_uri=http://xxx.xxxx.xx/&state=someRandomStr
* 4. This code is run on `redirect_uri`.
* 5. Save the `access_token` for future message sending. (`code` can be used only once)
*/
/**
@kong0107
kong0107 / lineNotify.php
Created September 24, 2022 04:57
LINE Notify
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LINE Notify by PHP</title>
<style>body { white-space: pre; }</style>
</head>
<body>
<?php
@kong0107
kong0107 / lineNotify.js
Last active September 21, 2022 15:38
trigger line notify in different environments
/**
* See [LINE Notify API]{@link https://notify-bot.line.me/doc/en/} (Notification section)
* and [Fetch API]{@link https://developer.mozilla.org/en-US/docs/Web/API/fetch#parameters}.
*/
const response = await fetch(
"https://notify-api.line.me/api/notify",
{
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
@kong0107
kong0107 / setItem.js
Created January 14, 2019 10:15
用 React.Component.setState 的方式改寫 AsyncStorage.setItem 和 AsyncStorage.multiSet
/**
* 用 React.Component.setState 的方式改寫 AsyncStorage.setItem 和 AsyncStorage.multiSet
* 但注意後者只支援存入字串。
* @param {Object} obj
* @returns {Promise}
*/
import {AsyncStorage} from 'react-native';
const setItem = obj => {
const keyValuePairs = [];
for(let key in obj) {
@kong0107
kong0107 / templatePagination.html
Last active December 16, 2015 13:02
Paginate by AngularJS
<nav ng-show="items.length > itemsPerPage">
Page:
<ul>
<li ng-repeat="noUse in items track by $index"
ng-if="!($index % itemsPerPage)"
ng-click="Q_Q.skip = $index"
style="cursor: pointer; border: 1px solid #ccc; display: inline-block; padding: 0.2em;"
>{{$index / itemsPerPage + 1}}</li>
</ul>
</nav>
[[阿空]]
我覺得代理孕母其實最大的爭議是墮胎相關
[[說明]]
代孕議題另一憂慮是與性工作之相似;
反對性工作之理由
(例如可能誘發剝削與人口販運)
幾乎均亦可用於反對代孕制度。
[[阿空]]
[[阿空]]
這邊感謝 h*ours 咖啡店提供場地
[[說明]]
壹、親屬、家屬
貳、婚生推定
參、收養
肆、繼承
伍、單方終止
陸、通姦
@kong0107
kong0107 / gist:7789636
Created December 4, 2013 15:36
Reply to 羅毓嘉〈隔離的平等,與不平等〉
https://www.facebook.com/cyrus.li2/posts/10200580216787477
http://yclou.blogspot.tw/2013/12/blog-post_4.html
我的話會說「所謂與婚姻相關的法律,狹義來說都僅是規範配偶之間的權利義務,以及身為一個『有配偶的人』與社會的聯結規範」,也就是不需要藉由「兩性平等運動多年」來得出「夫、妻的權利與義務一致」(雖然歷史過程的確是那樣)。
因此,要檢視的其實只有「男女有別」的那些法規。而撇開那些「為了給女性實質平等」而刻意創造的差別待遇,要檢視的也就只有三種情形:義務役、生理期、懷孕。
更細緻地說,除了「夫」、「妻」這個用語,現行法最多也就區分「有配偶的男性」和「有配偶的女性」(【性別工作平等法】中關於產假的規定),而不是以「有男性配偶的人」和「有女性配偶的人」做為區分標準,因此不需要煩惱在「有男性配偶的男性」及「有女性配偶的女性」的情形會出現矛盾的法規。
(唔,義務役或許有關於「配偶懷孕」的一些規定,但那也只是會導出差別待遇,而並不是法規無法運作。)
真要另立其他法律的話,也只要「同性配偶,視為夫妻」就解決了--大不了再追加一些反方很想要、但寫下去就是可以輕易解釋成「同性戀比殺人犯還不如」並因而違憲的條文(例如「禁止同性配偶共同收養」)。