Skip to content

Instantly share code, notes, and snippets.

View lovecn's full-sized avatar

domainbank lovecn

View GitHub Profile
from pyv8 import PyV8
string = '''
function _a(d){for(var b="",a=0,c=c1=c2=0;a<d.length;)c=d.charCodeAt(a),128>c?(b+=String.fromCharCode(c),a++):191<c&&224>c?(c2=d.charCodeAt(a+1),b+=String.fromCharCode((c&31)<<6|c2&63),a+=2):(c2=d.charCodeAt(a+1),c3=d.charCodeAt(a+2),b+=String.fromCharCode((c&15)<<12|(c2&63)<<6|c3&63),a+=3);return b} function _b(a,b){b=a.length-b;return a.substr(b)+a.substr(0,b)}function _c(a,i,j){a[i%a.length]=a.splice(j%a.length,1,a[i%a.length])[0];}function _d(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("func
#-*- coding=utf-8 -*-
"""
知乎图片下载器
"""
import requests
import re
import json
import time
from PIL import Image
import cStringIO
@jae-jae
jae-jae / ThunderDL.user.js
Last active August 11, 2022 15:52
[Tampermonkey脚本]获取页面内所有迅雷下载链接,启动快捷键 alt+x
// ==UserScript==
// @name 嗅探迅雷链接 Jaeger
// @namespace https://gist.github.com/jae-jae/70f175342130f11df1ae7bd54b93581e
// @version 1.4.6
// @description 嗅探页面内所有迅雷下载链接,方便批量离线下载
// @author Jaeger <JaegerCode@gmail.com>
// @icon http://lixian.vip.xunlei.com/favicon.ico
// @include http*
// @require https://raw.githubusercontent.com/jae-jae/l.js/master/userjs/l.userjs.min.js
// @require https://gist.githubusercontent.com/jae-jae/35a1833079d26e6c9d9c6d5bed982353/raw/userjs-base.js
@jcouyang
jcouyang / why-curry-helps.md
Last active February 20, 2023 21:09
为什么要柯里化(why-curry-helps)slide http://git.io/why-curry-helps 📈

还记得 Haskell Curry吗,

多巧啊, 人家姓 Curry 名 Haskell, 难怪 Haskell 语言会自动柯里化, 呵呵. 但是不奇怪吗, 为什么要柯里化呢. 为什么如此重要导致 Haskell 会默认自动柯里化所有函数, 不就是返回一个部分配置好的函数吗.

我们来看一个 Haskell 的代码.

max 3 4
(max 3) 4
@edokeh
edokeh / index.js
Last active September 16, 2024 16:21
佛祖保佑,永无 BUG
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@oodavid
oodavid / README.md
Last active June 12, 2024 00:28 — forked from aronwoost/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@isaacs
isaacs / comma-first-var.js
Created April 6, 2010 19:24
A better coding convention for lists and object literals in JavaScript
// See comments below.
// This code sample and justification brought to you by
// Isaac Z. Schlueter, aka isaacs
// standard style
var a = "ape",
b = "bat",
c = "cat",
d = "dog",