Skip to content

Instantly share code, notes, and snippets.

View sfengyuan's full-sized avatar
🎯
Focusing

sunfy sfengyuan

🎯
Focusing
  • China
View GitHub Profile
@sfengyuan
sfengyuan / Chnese_punctuation_list.txt
Created September 26, 2022 17:14
Chinese punctuation list
'。?!,、;:“”‘’( ) [ ] { }——……《 》〈 〉.·— ____/'
@sfengyuan
sfengyuan / clean-bad-unicode.js
Last active August 7, 2022 15:35
clean bad Unicode
/*
date: 2022/8/7 23:34
*/
export default function (str) {
const garbageSpaces = [
'\u00A0', // No-Break Space
'\u3000', // ideographic space
'\u2000', // En quad space
'\u2001', // Em quad space
'\u2002', // En space
@sfengyuan
sfengyuan / reset.css
Last active January 30, 2021 16:28
CSS reset
/* css reset */
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, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font: inherit;
font-size: 100%;
vertical-align: baseline;
}
@sfengyuan
sfengyuan / .gitignore
Created October 20, 2017 17:31
gitignore for frontend project
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
*.cache
# dependencies
node_modules
@sfengyuan
sfengyuan / numbers.js
Created October 11, 2017 06:10
Javascript
function round(value, decimals) {
return Number(Math.round(value+'e'+decimals)+'e-'+decimals);
}
//round(1.005, 2);
// 1.01
@sfengyuan
sfengyuan / Open with
Last active August 25, 2022 10:34
Settings on Windows: open with sublime text and vs code, scoop python registry entries
@echo off
SET AppKey=SublimeText3
SET AppTitle=Sublime Text 3
SET AppPath=D:\Program Files\st\sublime_text.exe
SET AppIcon=%AppPath%,0
REG ADD "HKEY_CLASSES_ROOT\*\shell\%AppKey%" /ve /f /d "%AppTitle%"
REG ADD "HKEY_CLASSES_ROOT\*\shell\%AppKey%" /v "Icon" /f /d "%AppIcon%"
REG ADD "HKEY_CLASSES_ROOT\*\shell\%AppKey%\command" /ve /f /d "%AppPath% \"%%1\""