Skip to content

Instantly share code, notes, and snippets.

View front-thinking's full-sized avatar
🎯
Focusing

front-thinking

🎯
Focusing
  • Tencent
  • ShenZhen,China
View GitHub Profile
@front-thinking
front-thinking / imagePreloader.js
Created January 12, 2016 00:49
图片预加载(代理模式)
var myImage = (function (){
var imgNode = document.createElement('img');
document.body.appendChild(imgNode);
return {
setSrc: function(src){
imgNode.src = src;
}
}
})();
@front-thinking
front-thinking / cloudSettings
Created June 2, 2020 10:42 — forked from huruji/cloudSettings
code_settings_2020
{"lastUpload":"2020-06-02T09:16:19.677Z","extensionVersion":"v3.4.3"}
@front-thinking
front-thinking / introrx.md
Created May 29, 2018 08:00 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@front-thinking
front-thinking / memorySizeOfObject.js
Created January 12, 2017 06:21
calculate memory size of javascript object, it is not a accurate value!
function memorySizeOf(obj) {
var bytes = 0;
function sizeOf(obj) {
if(obj !== null && obj !== undefined) {
switch(typeof obj) {
case 'number':
bytes += 8;
break;
case 'string':
@front-thinking
front-thinking / iterator.js
Created January 12, 2016 01:56
自己动手实现的迭代器-简易版
var each = function (arr, callback){
for(var i=0, l=arr.length; i<l; i++){
callback.call(arr[i], i, arr[i]);
}
};
each([1, 2, 3], function (i, n){
console.log([i, n]);
});
@front-thinking
front-thinking / 404checker.js
Created October 21, 2015 02:21 — forked from n1k0/404checker.js
A CasperJS script to check for 404 & 500 internal links on a given website
/**
* This casper scipt checks for 404 internal links for a given root url.
*
* Usage:
*
* $ casperjs 404checker.js http://mysite.tld/
* $ casperjs 404checker.js http://mysite.tld/ --max-depth=42
*/
/*global URI*/
@front-thinking
front-thinking / 前端打点.md
Created October 12, 2015 16:18 — forked from airyland/前端打点.md
前端错误监控

前端错误监控

注:目前是前端实验性质的工具。

开发环境和用户使用环境不一致,开发时无法对所有浏览器做测试。但是由用户来反馈错误过于被动。为了主动地收集错误并解决,在网页上加了一个JavaScript错误监控脚本。

window.onerror捕获页面上的JavaScript运行错误,并使用beacon的方式保存到seedit.duapp.com上。

window.onerror

@front-thinking
front-thinking / frontendDevlopmentBookmarks.md
Created October 12, 2015 08:39 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.