Skip to content

Instantly share code, notes, and snippets.

View hayeah's full-sized avatar
🕳️
Focusing

blah blah hayeah

🕳️
Focusing
View GitHub Profile
@hayeah
hayeah / gist:52b67ee963066ef66b727bf005930add
Last active August 9, 2018 06:42
EVM Homstead Instruction Set
0x00 STOP
0x01 ADD
0x02 MUL
0x03 SUB
0x04 DIV
0x05 SDIV
0x06 MOD
0x07 SMOD
0x08 ADDMOD
0x09 MULMOD
@hayeah
hayeah / bug.md
Created July 27, 2017 08:17
crowdfund example exploit
@hayeah
hayeah / require.js
Created October 29, 2016 02:35
wx app require implementation
var dir = function (e) {
var t = e.match(/(.*)\/([^\/]+)?$/);
// 默认相对于当前目录
return t && t[1] ? t[1] : "./"
},
// the inner require path is relative to the base directory of the requiring file.
_require = function (path) {
var baseDir = dir(path);
return function (e) {
if ("string" != typeof e) throw new Error("require args must be a string");
/*
gfw_whitelist.pac
GFW Whitelist
- inspired by autoproxy and chnroutes
v1.2
Author: n0gfwall0@gmail.com
License: MIT License
@hayeah
hayeah / upsert.js
Last active July 28, 2020 10:40
monkey patch knex.js for PostgreSQL 9.5 upsert
const BaseQueryCompiler = require("knex/lib/query/compiler");
/*
db = knex({
client: "pg",
connection: config.postgresURL,
debug: true,
});
upsertMonkeyPatch(db);
@hayeah
hayeah / webpack.config.js
Created December 30, 2015 02:42
webpack example
var path = require("path");
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
// The standard entry point and output config
entry: {
static: "./assets/static.js",
},
output: {
path: path.join(__dirname,"src","assets"),
// publicPath: "/assets/",
window.countriesData = [
{
"countryCode": "AD",
"countryName": "Andorra",
"capital": "Andorra la Vella",
"continentName": "Europe"
},
{
"countryCode": "AE",
"countryName": "United Arab Emirates",
grep '/swapfile' /proc/swaps > /dev/null && echo swap already setup && exit
dd if=/dev/zero of=/swapfile bs=1M count=$[1024 * 2] && \
mkswap /swapfile && \
swapon /swapfile && \
echo '/swapfile swap swap auto 0 0' | tee -a /etc/fstab
@hayeah
hayeah / gist:108a636a8ec547dee2b9
Created March 17, 2015 06:40
extensible markdown
# tags
A tag is a line that starts with a "#". Here a tag called foo:
#foo("arg1" "arg2" opt1="a" opts2="b")
content of foo
can have
many text blocks
.menu {
__layout { display: inline; }
__layout-item { display: inline-block; ... }
__item { _state_current { font-weight: bold; } }
}