Skip to content

Instantly share code, notes, and snippets.

View yangjunjun's full-sized avatar
🐱
Focusing

杨军军 yangjunjun

🐱
Focusing
  • undefined
  • Xian, Shaanxi, China
View GitHub Profile
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//
@addyosmani
addyosmani / memoize.js
Created September 18, 2011 16:33
memoize.js - a faster JavaScript memoizer
/*
* memoize.js
* by @philogb and @addyosmani
* further optimizations by @mathias
* Released under an MIT license.
*/
function memoize( fn ) {
return function () {
var args = Array.prototype.slice.call(arguments),
hash = "",
@feross
feross / gist:1936676
Created February 29, 2012 01:00
memoizer.js
var count = 0;
var memoizer = function(memo, formula) {
var recur = function(n) {
var result = memo[n];
if (typeof result !== "number") {
result = formula(n);
memo[n] = result;
}
return result;
@cbrammer
cbrammer / installer.js
Created October 19, 2012 22:42
NPM Sucks
var npm = require('npm')
, pack = require('./package.json')
, modules = {}
;
if(pack.dependencies) build(pack.dependencies);
if(pack.optionalDependencies) build(pack.optionalDependencies);
if(pack.devDependencies) build(pack.devDependencies);
function build(dependancies) {
@mbostock
mbostock / .block
Last active January 31, 2024 11:52
Hexagonal Binning (Color)
license: gpl-3.0
redirect: https://observablehq.com/@d3/d3-hexbin
@paranoidxc
paranoidxc / V2EX.user.js
Last active December 14, 2015 09:28
固定 V2EX 的导航栏, 双击导航栏页面回到顶部,每日自动签到。
// ==UserScript==
// @author iParanoid
// @name V2EX_User_Script
// @namespace https://zone-huangxc.rhcloud.com
// @description Position fixed the navigation , Scroll to top when double click navigation bar or Page Footer
// @include *
// @updateURL https://gist.github.com/paranoidxc/5065236/raw/10bc3ee7501b86f2e579657ef64348e642cc2a70/V2EX.user.js
// ==/UserScript==
function iparanoid_wrapper() {
@wintercn
wintercn / showboxes.js
Created May 21, 2013 06:34
显示页面的盒结构
function randomColor(){
return "rgb("+Math.floor(Math.random()*255)+","+Math.floor(Math.random()*255)+","+Math.floor(Math.random()*255)+")";
}
function showBoxes(window) {
var rects = [];
function getRects(node){
var range = window.document.createRange();
range.setStartBefore(node);
range.setEndAfter(node);
@wintercn
wintercn / HTMLLexicalParser.js
Last active August 5, 2019 11:16
HTML语法分析器模型
function StartTagToken(){
}
function EndTagToken(){
}
function Attribute(){
}
@cmartinbaughman
cmartinbaughman / GoogleHackMasterList.txt
Last active April 17, 2024 14:57
The definitive super list for "Google Hacking".
admin account info" filetype:log
!Host=*.* intext:enc_UserPassword=* ext:pcf
"# -FrontPage-" ext:pwd inurl:(service | authors | administrators | users) "# -FrontPage-" inurl:service.pwd
"AutoCreate=TRUE password=*"
"http://*:*@www” domainname
"index of/" "ws_ftp.ini" "parent directory"
"liveice configuration file" ext:cfg -site:sourceforge.net
"parent directory" +proftpdpasswd
Duclassified" -site:duware.com "DUware All Rights reserved"
duclassmate" -site:duware.com
@missett
missett / JS Quicksort
Created October 24, 2013 11:47
Recursive Quicksort implementation in JS
function quicksort(input) {
if(input.length === 0) return input;
var head = input[0],
tail = input.slice(1);
var less = tail.filter(function(i) {
return i < head ? true : false;
});