Skip to content

Instantly share code, notes, and snippets.

View lichin-lin's full-sized avatar

lichin lin lichin-lin

View GitHub Profile
// Figma's 2024 April Fools' Day Windows 95 extension. It's messy, but cool
// for buttons
const buttons = document.getElementsByTagName("button");
const buttonList = Array.from(buttons);
buttonList.map((b) =>
b.setAttribute(
"style",
`
border-radius: 0;
@lichin-lin
lichin-lin / heart.js
Last active February 14, 2024 14:16
💝 v-day-dev-mode
const r = document.querySelector('div [data-testid=annotation-renderer-shadow-dom-container]')
let duration = 4000
const speed = 0.5;
const cursorXOffset = 0;
const cursorYOffset = -5;
let hearts = []
function generateHeart(x = 0, y = 0, xBound, xStart, scale, parent) {
let heart = document.createElement("div");
heart.setAttribute('class', 'heart');
let canvas, context;
function getTemporaryCanvasContext () {
if (!canvas || !context) {
canvas = document.createElement('canvas');
context = canvas.getContext('2d');
}
return { canvas, context };
}
@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": "*",
@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 / 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 / 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')
import csv
import urllib.request
import codecs
import re
import sys
import math
import time
import json
import requests
import pyrebase
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>
@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,