Skip to content

Instantly share code, notes, and snippets.

View yangfch3's full-sized avatar
🎯
Focusing

Fucheng Yang yangfch3

🎯
Focusing
  • NetEase
  • Internet
View GitHub Profile
@yangfch3
yangfch3 / repl-curl.js
Last active August 23, 2018 01:57 — forked from TooTallNate/bbs.js
使用 repl 模块搭建一个面向 curl 的 SREPL
/**
* Requires node v0.7.7 or greater.
*
* To connect: $ curl -sSNT. localhost:8000
*/
var http = require('http')
, repl = require('repl')
, buf0 = new Buffer([0])
@yangfch3
yangfch3 / repl-client.js
Last active August 23, 2018 01:43 — forked from TooTallNate/repl-client.js
最简单 REPL WebShell Node.js 实现 - 基于 net 与 repl 模块
var net = require('net')
var sock = net.connect(1337)
process.stdin.pipe(sock)
sock.pipe(process.stdout)
sock.on('connect', function () {
process.stdin.resume();
process.stdin.setRawMode(true)
@yangfch3
yangfch3 / jQuery-plugin-authoring.md
Created March 12, 2017 09:19 — forked from quexer/jQuery-plugin-authoring.md
如何编写 jQuery 插件

创建插件


看来 jQuery 你已经用得很爽了,想学习如何自己编写插件。非常好,这篇文档正适合你。用插件和方法来扩展 jQuery 非常强大,把最聪明的功能封装到插件中可以为你及团队节省大量开发时间。

开始

<script\x20type="text/javascript">javascript:alert(1);</script>
<script\x3Etype="text/javascript">javascript:alert(1);</script>
<script\x0Dtype="text/javascript">javascript:alert(1);</script>
<script\x09type="text/javascript">javascript:alert(1);</script>
<script\x0Ctype="text/javascript">javascript:alert(1);</script>
<script\x2Ftype="text/javascript">javascript:alert(1);</script>
<script\x0Atype="text/javascript">javascript:alert(1);</script>
'`"><\x3Cscript>javascript:alert(1)</script>
'`"><\x00script>javascript:alert(1)</script>
<img src=1 href=1 onerror="javascript:alert(1)"></img>
@yangfch3
yangfch3 / what-forces-layout.md
Last active September 13, 2018 01:18 — forked from paulirish/what-forces-layout.md
[会导致 layout/reflow 的条目] #tiny_handbook

What forces layout / reflow

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.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@yangfch3
yangfch3 / core.js
Last active September 13, 2018 01:17 — forked from Saul-Mirone/mini-express.js
[Express 风格框架简易实现] #原理或简易实现
const http = require('http')
const url = require('url')
const path = require('path')
const fs = require('fs')
const mime = {
"html": "text/html",
"css": "text/css",
"js": "text/javascript",
"json": "application/json",
"gif": "image/gif",
@yangfch3
yangfch3 / Wikipedia-telnet.js
Last active March 2, 2017 07:58 — forked from atdt/wp-telnet.js
Wikipedia Telnet Server - Node Version
// Wikipedia telnet server
//
// To install depenedncies:
// npm install request
// npm install cheerio
//
var net = require( 'net' );
var cheerio = require('cheerio');
var request = require('request');
@yangfch3
yangfch3 / HTML-tags.md
Created March 14, 2016 05:48 — forked from yisibl/HTML-tags.md
常用的 HTML 头部标签

常用的 HTML 头部标签

详细介绍参见原文:yisibl/blog#1

<!DOCTYPE html> <!-- 使用 HTML5 doctype,不区分大小写 -->
<html lang="zh-cmn-Hans"> <!-- 更加标准的 lang 属性写法 http://zhi.hu/XyIa -->
<head>
    <meta charset='utf-8'> <!-- 声明文档使用的字符编码 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <!-- 优先使用 IE 最新版本和 Chrome -->
@yangfch3
yangfch3 / sublime-scopes.txt
Last active August 29, 2016 07:54 — forked from iambibhas/scopes.txt
Sublime Text 2: Snippet scopes
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee