⌘T | 切換檔案 |
⌘⌃P | 切換專案 |
⌘R | 畫面切換到 method |
⌃G | 畫面切換到指定行數 |
⌘KB | 關閉 / 開啟側邊欄 |
⌘⇧P | 開啟指令控制面板 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n | |
zh-TW: | |
errors: | |
messages: | |
expired: "已經過期,請重新申請一個" | |
not_found: "找不到" | |
already_confirmed: "已經驗證,請直接登入" | |
not_locked: "被鎖定了" | |
not_saved: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Automaticlly install pptpd on Amazon EC2 Amazon Linux | |
# | |
# Ripped from http://blog.diahosting.com/linux-tutorial/pptpd/ | |
# pptpd source rpm packing by it's authors | |
# | |
# WARNING: | |
# first ms-dns setting to 172.16.0.23, 172.16.0.23 was showing on my | |
# /etc/resolv.conf, I'm not sure this is the same on all Amazon AWS zones. | |
# | |
# You need to adjust your "Security Groups" which you are using too. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import Velocity from 'velocity-animate'; | |
let baseEasings = {}; | |
baseEasings.Bounce = p => { | |
let pow2; | |
let bounce = 4; | |
while (p < ((pow2 = Math.pow(2, --bounce)) - 1) / 11) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from http://scratch99.com/web-development/javascript/convert-bytes-to-mb-kb/ | |
function bytesToSize(bytes) { | |
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB']; | |
if (bytes == 0) return 'n/a'; | |
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024))); | |
if (i == 0) return bytes + ' ' + sizes[i]; | |
return (bytes / Math.pow(1024, i)).toFixed(1) + ' ' + sizes[i]; | |
}; |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
elem.clientLeft
,elem.clientTop
,elem.clientWidth
,elem.clientHeight
elem.getClientRects()
,elem.getBoundingClientRect()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fuzzy matching algorithm | |
var fuzzyMatch = function(needle, haystack) { | |
if(needle === "" || haystack === "") return true; | |
needle = needle.toLowerCase().replace(/ /g, ""); | |
haystack = haystack.toLowerCase(); | |
// All characters in needle must be present in haystack | |
var j = 0; // haystack position | |
for(var i = 0; i < needle.length; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uniform sampler2D tex; // matched from gst-plugin-gl uniform | |
const vec4 kappa = vec4(1.0,1.7,0.7,15.0); | |
// These can be made uniform if they are added to: | |
// gst/gl/gstglfiltershader.c:363 | |
// gst_gl_shader_set_uniform_1f (filtershader->shader0, "screen_width", width); | |
// gst_gl_shader_set_uniform_1f (filtershader->shader0, "screen_height", height); | |
const float screen_width = 1920.0; |
OlderNewer