Skip to content

Instantly share code, notes, and snippets.

View lichin-lin's full-sized avatar

lichin lin lichin-lin

View GitHub Profile
@lichin-lin
lichin-lin / IE.html
Last active August 27, 2016 08:09
IE8
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2/html5shiv.js"></script>
<script src="//s3.amazonaws.com/nwapi/nwmatcher/nwmatcher-1.2.5-min.js"></script>
<script src="//html5base.googlecode.com/svn-history/r38/trunk/js/selectivizr-1.0.3b.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.1.0/respond.min.js"></script>
<![endif]-->
@lichin-lin
lichin-lin / console.js
Created August 27, 2016 09:41
console.js
if (window.console){
// welcome console.log back to our world!
// use console.log() in side the function.
}
@lichin-lin
lichin-lin / index.js
Last active December 11, 2016 12:10
react SAT index.js example
import common from './common'
import App from './App'
import Base from './Base'
import Chart from './Chart'
import FirebaseTest from './FirebaseTest'
import Login from './Login'
import NotFound from './NotFound'
import SAT from './SAT'
export default {
common,
this.props.Stroke.colors.map((el, id) => (
<li key={id} >
<div className="colorBox" onClick={() => {this.cancelColor(id)}}
style= {{
background: el,
color: (() => (tinycolor(el).isDark() ? 'white' : 'black'))()
}}>
<p>{el}</p>
</div>
</li>
import csv
import urllib.request
import codecs
import re
import sys
import math
import time
import json
import requests
import pyrebase
@lichin-lin
lichin-lin / chat.py
Last active August 4, 2017 10:53
fbchat test
import facebook
from fbchat import Client
from fbchat.models import *
from datetime import datetime
server_last_check_time = datetime.now()
client = Client('粉絲帳號', '粉絲密碼..有這東西ㄇXD')
while True:
graph = facebook.GraphAPI(access_token='EAACEdEose0cBAGqKM6rDLTrXipOAd3Kr5ldLGprF2BSCF0Mjp9bWuP0OZBwYrwEaDC1bvPZAeYONpBYdZB04hTy0YRyB9WZAoW356UURclLhS9aVTTqP65oRdOsMhUOqftPKUbCnyZCFNkhyW682ZBaQqwMs6ySYjcHw6tfBy6eYpURVEujGHhDnrAZCuskeLEZD', version='2.9')
@lichin-lin
lichin-lin / camphor.scss
Created December 13, 2017 06:48 — forked from bdno86/camphor.scss
camphor
$camphor300:'d09GMgABAAAAAQ5UABIAAAAEn0QAAQ3tAAEZmQAAAAAAAAAAAAAAAAAAAAAAAAAAG4SkahzOKgZgFotgAIosCCIJgnMRCAqLlgCKvTwBNgIkA5lwE4GnDguZdAAEIAW7bwcgDHJb0WS0WUXZkokWaBHx4wKbY7TigANIU/t980QCGzI/IkCsdbqJZwY1ZOgWDngIamw3I43435Dd+zJ1kNmKVp/DvXNAwaNm//////////////////+/NZkMZ5cAl0CpbZ3oiwloFA5GyIWNzOYVLt1bpXPX+pABI2fo5rMZpgVYIzYqgxt92ajECqUKh2G9gaOCVRC23VSRVypHfbvb7wYcwEM25WArF0esm1yKzDixrJRdcBGtcpBZTFbFbIl8LIU4gWOnEdSITqkoGrHWJ8ywn9eVFWWk3lC6m07qp1TXntHaWp6ekYHLrFoyzOXYiQnn2kWX2zqMaFBTca25vHKndPhJV66HRhQzL9lB3OT20KGTXuFHu62wm1qzoV/iTnaiLdc8o/D7B+1O94BrjSE3cia6U1A5XNp0kHmUj8IMBaeiGaiNJV7b1csb0bq8EWYo2h1TuipR+7hmYjxeZsonGLNcmgsKp5EUDCEj9SvRyxX2uMUNfINmfNqglBYNNtjtNmdwWV2ly4uQKheyDyka2RTRoQ3IEfs+0BNcGJ4Z5AnmHNpFbCKW5PsXkAzJ6VVzzVMo0fwIUpQQT67itTNRE946/NxDashl9KuAFUbZ6yW91vObh+WAMZ1mQ1J4wotF6KXHuo65X6wSz406hW/T6XZMf/6W+HGYUxCDfhyjPaoMGcWccmbYM/H35NdHTOd79Jg0ho/BDBvRy2vcg8pHsv07UYiKrDFeqzL0Qk7qCkXLuukl2EKuR3xS6VtsLEaT0BfWoDYoQ1YvEjjT729XNMYoCX3j+2ApedBG/UHLOJ7AAnfPSqdmmePsY+522MpfPaf7kf6fIJMn0/4SE6PmuI3yjyeGjWn+1qj/ukf09DE
@lichin-lin
lichin-lin / golang_job_queue.md
Created April 19, 2020 17:14 — forked from harlow/golang_job_queue.md
Job queues in Golang
@lichin-lin
lichin-lin / notion2blog.js
Created May 2, 2020 14:29 — forked from mayneyao/notion2blog.js
Notion.so > Personal Blog | custom domain + disqus comment
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
let canvas, context;
function getTemporaryCanvasContext () {
if (!canvas || !context) {
canvas = document.createElement('canvas');
context = canvas.getContext('2d');
}
return { canvas, context };
}