Skip to content

Instantly share code, notes, and snippets.

View hoyangtsai's full-sized avatar
⌨️
Prompting

Hoyang Tsai hoyangtsai

⌨️
Prompting
View GitHub Profile
https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties
# editorconfig.org
root = true
[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
@hoyangtsai
hoyangtsai / sector.html
Created July 8, 2016 10:11
svg animation
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<style>
circle {
stroke-dashoffset: 100px;
animation: sector 1s linear;
}
@hoyangtsai
hoyangtsai / compress-images.sh
Created July 14, 2016 08:01
Automator Compress Images Right-click Service
for f in "$@"
do
echo $f | while IFS= read file
do
filename=$(basename $file)
ext=$(echo ${filename##*.} | tr "[:upper:]" "[:lower:]")
if [ -f $file ]
then
if ( [ $ext == "png" ] || [ $ext == "jpg" ] || [ $ext == "jpeg" ] )
@hoyangtsai
hoyangtsai / fb_love.js
Last active February 26, 2020 12:29
facebook love animation
if (self.CavalryLogger) { CavalryLogger.start_js(["MM5yP"]); }
__d("UFIReactionsStaticVectorIcons",[],(function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports={LIKE:{features:[{fill_color:"#ff5d9ff5",key:1,key_frames:{"0":[["M",[176.25,88.25]],["C",[176.25,136.85,136.85,176.25,88.25,176.25]],["C",[39.65,176.25,.25,136.85,.25,88.25]],["C",[.25,39.65,39.65,.25,88.25,.25]],["C",[136.85,.25,176.25,39.65,176.25,88.25]]]}}],frameCount:1,frameRate:24,groups:[{id:1,animations:[{anchor:[45.556500185916,96.812569457121],key_frames:{"0":[47.6262,121.0817]},property:"POSITION"},{anchor:[45.556500185916,96.812569457121],key_frames:{"0":[0]},property:"ROTATION"}],features:[{fill_color:"#ffffffff",key:2,key_frames:{"0":[["M",[47.28,84.67]],["C",[45.59,84.67,44.46,85.6,44.46,87.18]],["L",[44.46,129.75]],["C",[44.46,131.33,45.59,132.42,47.28,132.42]],["L",[61.37,132.42]],["C",[63.06,132.42,64.1,131.33,64.1,129.75]],["L",[64.1,87.18]],["C",[64.1,85.6,63.06,84.67,61.37,84.67]],["L",[47.28,84.67]]]}},{animations:
@hoyangtsai
hoyangtsai / package.json
Last active February 17, 2017 11:20
npm script for development
{
"name": "queryselector",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"server": "hs ./",
"watch": "livereload .",
"scss": "node-sass -w scss/ -o css/ --include-path \"console.log(process.cwd())\"",
"dev": "npm run server | npm run watch | npm run scss"
@hoyangtsai
hoyangtsai / _reset.css
Last active December 27, 2021 06:57
#CSS reset
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@hoyangtsai
hoyangtsai / index.html
Last active May 16, 2017 02:53
iOS switch
<div class="mod-switch-wrap">
<input type="checkbox" class="mod-switch" id="checkbox-1">
<label for="checkbox-1"></label>
</div>
@hoyangtsai
hoyangtsai / horiz-scroll.js
Last active January 13, 2019 08:09
Horizontal scroll and svg dot indicator with Hammer gesture
/**
* @horiz-scroll.js
* @author hoyangtsai
* @version 0.1
*/
function HorizScroll(options) {
this.container = options.container;
this.list = options.list;
this.item = options.item;
@hoyangtsai
hoyangtsai / _bem.scss
Last active December 27, 2021 07:00
#BEM #SCSS #SASSMixin
$element-separator: '__';
$modifier-separator: '--';
$when-separator: '.is-';
$component: 'el' !default;
$component-separator: '-';
//bem
@function bem($b, $e: null, $m: null, $c: $component) {
$block: $c + $component-separator + $b;
$element: '';
@hoyangtsai
hoyangtsai / check_hk_iphonex.js
Last active December 3, 2017 07:52
check availability of iPhoneX at Apple HK online store
const https = require('https');
const stores = [
['R409', 'Causeway'],
['R428', 'IFC_Mall'],
['R499', 'Canton_Road'],
['R485', 'Festival'],
['R673', 'A_M_P']
];
const options = {