Skip to content

Instantly share code, notes, and snippets.

@Rplus
Last active February 24, 2016 02:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rplus/7671448 to your computer and use it in GitHub Desktop.
Save Rplus/7671448 to your computer and use it in GitHub Desktop.

漸層 bgi
background-image linear-gradient


讓CSS正確顯示中文字體 http://benlibra.blogspot.tw/2011/04/css.html

escape('微軟正黑體').replace(/%u/g, '\\');

=> "\5FAE\8EDF\6B63\9ED1\9AD4"


multiline ellipsis

http://zetajames.wordpress.com/2012/02/13/text-overflow/ text-overflow: ellipsis; at multi-line

{
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 6; /* 第六行要顯示點點點 */
  -webkit-box-orient: vertical;
}

Learn CSS Positioning in Ten Steps (en) http://www.barelyfitz.com/screencast/html-training/css/positioning/ (zh) http://www.see-design.com.tw/i/css_position.html

<select>
  <option disabled selected style="display: none;">請選擇</option>
  <option value="xxx">第一項</option>
</select>

效果: 預設會 selected 到第一項

  • disabled: 但點開後第一項便會被略過無法選取
  • display: none;: 下拉選單中該項隱藏

適合需要提示用的 select

@Rplus
Copy link
Author

Rplus commented Aug 24, 2014

http://www.mobify.com/blog/multiline-ellipsis-in-pure-css/
非常 tricky 的定位方式
float + margin-left
替 多行文字自動加上 ellipsis 區塊 (pure css)

自己做的 trace page
http://jsbin.com/poves/2/edit

@Rplus
Copy link
Author

Rplus commented Sep 3, 2014

文字垂直對齊的計算器
https://drewish.com/tools/vertical-rhythm/

@Rplus
Copy link
Author

Rplus commented Sep 6, 2014

http://addyosmani.com/blog/image-optimization-tools/

2013 的文章
圖片優化工具介紹

  • grunt 自動化的
  • 本機跑的
  • 線上服務的

@Rplus
Copy link
Author

Rplus commented Oct 8, 2014

http://topheman.github.io/parallax/
有陀螺儀定位的 parallax

@Rplus
Copy link
Author

Rplus commented Oct 11, 2014

@Rplus
Copy link
Author

Rplus commented Oct 11, 2014

https://github.com/tiimgreen/github-cheat-sheet

github 操作指南(密技大補帖)

簡中版本 https://github.com/tiimgreen/github-cheat-sheet/blob/master/README.zh-cn.md

gist suffix with .pibb 後就變成 html 了耶~
方便使用 iframe 包起來~
( 試了一下 secret gist 也吃得到唷~ XDD


git show :/typo
搜尋 帶有 "typo" comment 的 commit

@Rplus
Copy link
Author

Rplus commented Oct 11, 2014

https://github.com/github/linguist/blob/master/lib/linguist/languages.yml
GFM(Github Favorite Markdown) 的 code 支援 syntax highlight

@Rplus
Copy link
Author

Rplus commented Oct 11, 2014

http://csspre.com/
CSS preprocessors 的比較文
SASS LESS Stylus
有各個的有趣用法,非常值得一讀

@Rplus
Copy link
Author

Rplus commented Oct 15, 2014

https://gist.github.com/jlong/2428561
將 字串 url 抽出各種 property 的小技巧 (pathname, hostname, search...)

主要是建一個 <a>
設定 href 後,這個 <a> 就能當程 location 一樣來抽出各種 property 了~

下方的回覆也有提及這方法的效率其實是比較低的

若要提高些效率,可以試試 new URL()
ref: https://developer.mozilla.org/en-US/docs/Web/API/URL.URL

效率比較: http://jsperf.com/url-parsing/25
ps: 那個 regexp 雖然高效,但基本上維護不了呀 囧

@Rplus
Copy link
Author

Rplus commented Oct 17, 2014

測試你的網站速度!
http://www.webpagetest.org/

@Rplus
Copy link
Author

Rplus commented Oct 22, 2014

http://html5pattern.com/
一堆常用 regexp 的範例

@Rplus
Copy link
Author

Rplus commented Nov 5, 2014

http://contrastchecker.com/
線上 對比檢測 工具
color

@Rplus
Copy link
Author

Rplus commented Nov 5, 2014

https://github.com/showcases
github 熱門 repo 合輯

@Rplus
Copy link
Author

Rplus commented Nov 5, 2014

http://ixdchecklist.com/
interaction design 互動設計線上自我檢查表

@Rplus
Copy link
Author

Rplus commented Dec 26, 2014

http://jquerymy.com/
jquery base 的 two-way data binding plugin

@Rplus
Copy link
Author

Rplus commented Jan 12, 2015

http://jex.im/regulex/
Regulex JavaScript Regular Expression Visualizer.

@Rplus
Copy link
Author

Rplus commented Jan 12, 2015

http://viewportsizes.com/
羅列各種裝置的 viewport 可視區長寬尺寸

@Rplus
Copy link
Author

Rplus commented Jan 21, 2015

http://www.mergely.com/editor
online diff tools
merge

@Rplus
Copy link
Author

Rplus commented Feb 6, 2015

http://devdocs.io/
api 查找工具,可離線!!
offline mod 以 indexedDB cached 處理

@Rplus
Copy link
Author

Rplus commented Mar 2, 2015

about link:

https://medium.com/de-correspondent/links-are-broken-these-three-alternatives-have-improved-our-readers-reading-experience-796c302c8930
這篇說說它怎麼處理連結,
即便是連結換了,還能保有部分資訊可供參考

@Rplus
Copy link
Author

Rplus commented Mar 20, 2015

http://arasatasaygin.github.io/is.js/
is.js
輔助判斷各種 js 的 type

@Rplus
Copy link
Author

Rplus commented Mar 20, 2015

https://cssanimation.rocks/

css animation news & cool sample

@Rplus
Copy link
Author

Rplus commented Apr 8, 2015

Javascript Chart Libraries
http://blog.webkid.io/javascript-chart-libraries/

quick overview about open source javascript chart libraries (mostly D3 based)

@Rplus
Copy link
Author

Rplus commented Apr 8, 2015

以 Firefox 開發者工具在 GitHub 上除錯 fetch()
http://blog.mozilla.com.tw/posts/7293/devtool-github-fetch

video

https://youtu.be/PUgRMRQoTq4

未讀

@Rplus
Copy link
Author

Rplus commented Apr 8, 2015

http://www.oxxostudio.tw/
認真在寫前端技術文的部落格

@Rplus
Copy link
Author

Rplus commented Apr 17, 2015

http://www.myscriptfont.com/
客製化手寫字型服務

@Rplus
Copy link
Author

Rplus commented May 20, 2015

contenteditable detect snippet
via: http://stackoverflow.com/a/18316972/3893926

主要修正 Chrome 支援 rich-text 輸入方式
在一些需純文字區塊會有 copy & paste 卻帶有 style 的狀況

var isSupportsPlaintextEditable = (function () {
    var div = document.createElement('div');
    div.setAttribute('contenteditable', 'PLAINTEXT-ONLY');

    return div.contentEditable === 'plaintext-only';
})();

console.log(isSupportsPlaintextEditable);

@Rplus
Copy link
Author

Rplus commented May 20, 2015

http://howtocenterincss.com/
各式 center 方式

@Rplus
Copy link
Author

Rplus commented Jun 28, 2015

  • asda
  • asdasd

@Rplus
Copy link
Author

Rplus commented Dec 10, 2015

http://navnav.co/
很多選單的 demo
layout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment