Skip to content

Instantly share code, notes, and snippets.

@jacky810124
jacky810124 / README.md
Created February 8, 2018 18:25 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

request({
url: 'website url',
//禁止使用預設編碼
encoding: null
}, (error, response, body) => {
//body: 爬回來的網站
if(body){
}
});
var globalObject = this;
var foo = (() => this);
console.log(foo() === globalObject); // true
function bar() {
console.log(Object.prototype.toString.call(this));
}
bar.call(7); // [object Number]
bar.call('foo'); // [Object String]
// An object can be passed as the first argument to call or apply and this will be bound to it.
var obj = {a: 'Custom'};
// This property is set on the global object
var a = 'Global';
function whatsThis(arg) {
return this.a; // The value of this is dependent on how the function is called
}
function f2(){
"use strict"; // 嚴格模式
return this;
}
f2() === undefined;
function f1() {
return this;
}
// In a browser:
f1() === window; // true
// In Node:
f1() === global; // true
// In web browsers, the window object is also the global object:
console.log(this === window); // true
a = 37;
console.log(window.a); // 37
this.b = "MDN";
console.log(window.b) // "MDN"
console.log(b) // "MDN"
const regexpTable = {
tw: /^09\d{8}$/,
cn: /^1[34578]\d{9}$/,
hk: /^([6|9])\d{7}$/,
mo: /^[0][9]\d{8}$/
}
@jacky810124
jacky810124 / example.html
Created October 27, 2017 03:25
mapacode
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="4MVG5ES3Z4Y3J">
<input type="image" src="https://www.paypalobjects.com/zh_TW/TW/i/btn/btn_buynowCC_LG_wCUP.gif" border="0" name="submit"
alt="PayPal - 更安全、更簡單的線上付款方式!">
<img alt="" border="0" src="https://www.paypalobjects.com/zh_TW/i/scr/pixel.gif" width="1" height="1">
</form>