onSubmit event handler | form action redirect(submit success to backend) | |
---|---|---|
$.submit | ||
$.trigger | ||
HTMLFormElement.submit | ||
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const pageScript = (path, fn) => (...args) => { | |
$(document).on('turbolinks:load', () => { | |
const pageID = $('body').attr('id'); | |
const map = { | |
string: () => pageID === path, | |
object: () => path.some(x => x === pageID) | |
}; | |
const isAllow = map[typeof path](); | |
return isAllow ? fn(...args) : null; | |
}); |
layout | title | date | tags |
---|---|---|---|
title |
Introduce to Y Combinator with Javascript |
2018-03-24 15:46:19 -0700 |
梳理总结一下自己对 Y Combinator 理解,也来重新认识这样一个有趣的东西。
在开始之前有必要先来介绍一下图灵机和λ演算之间的关系。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# exit when checkout a file | |
[ "$3" == "0" ] && exit | |
cd gulp | |
echo "Checking npm modules" | |
npm ls > /dev/null && { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
゚ω゚ノ= /`m´)ノ ~┻━┻ //*´∇`*/ ['_']; o=(゚ー゚) =_=3; c=(゚Θ゚) =(゚ー゚)-(゚ー゚); (゚Д゚) =(゚Θ゚)= (o^_^o)/ (o^_^o);(゚Д゚)={゚Θ゚: '_' ,゚ω゚ノ : ((゚ω゚ノ==3) +'_') [゚Θ゚] ,゚ー゚ノ :(゚ω゚ノ+ '_')[o^_^o -(゚Θ゚)] ,゚Д゚ノ:((゚ー゚==3) +'_')[゚ー゚] }; (゚Д゚) [゚Θ゚] =((゚ω゚ノ==3) +'_') [c^_^o];(゚Д゚) ['c'] = ((゚Д゚)+'_') [ (゚ー゚)+(゚ー゚)-(゚Θ゚) ];(゚Д゚) ['o'] = ((゚Д゚)+'_') [゚Θ゚];(゚o゚)=(゚Д゚) ['c']+(゚Д゚) ['o']+(゚ω゚ノ +'_')[゚Θ゚]+ ((゚ω゚ノ==3) +'_') [゚ー゚] + ((゚Д゚) +'_') [(゚ー゚)+(゚ー゚)]+ ((゚ー゚==3) +'_') [゚Θ゚]+((゚ー゚==3) +'_') [(゚ー゚) - (゚Θ゚)]+(゚Д゚) ['c']+((゚Д゚)+'_') [(゚ー゚)+(゚ー゚)]+ (゚Д゚) ['o']+((゚ー゚==3) +'_') [゚Θ゚];(゚Д゚) ['_'] =(o^_^o) [゚o゚] [゚o゚];(゚ε゚)=((゚ー゚==3) +'_') [゚Θ゚]+ (゚Д゚) .゚Д゚ノ+((゚Д゚)+'_') [(゚ー゚) + (゚ー゚)]+((゚ー゚==3) +'_') [o^_^o -゚Θ゚]+((゚ー゚==3) +'_') [゚Θ゚]+ (゚ω゚ノ +'_') [゚Θ゚]; (゚ー゚)+=(゚Θ゚); (゚Д゚)[゚ε゚]='\\'; (゚Д゚).゚Θ゚ノ=(゚Д゚+ ゚ー゚)[o^_^o -(゚Θ゚)];(o゚ー゚o)=(゚ω゚ノ +'_')[c^_^o];(゚Д゚) [゚o゚]='\"';(゚Д゚) ['_'] ( (゚Д゚) ['_'] (゚ε゚+(゚Д゚)[゚o゚]+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ (゚ー゚)+ (゚Θ゚)+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((゚ー゚) + (゚Θ゚))+ (゚ー゚)+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ (゚ー゚)+ ((゚ー゚) + (゚Θ゚))+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((o |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section style="margin: 0 20px;"> | |
<section style="height: 1.5em;"> | |
<section style="height: 100%;width: 1.2em;float: left;border-top-width: 0.15em;border-top-style: solid;border-color: rgb(198, 198, 199);border-left-width: 0.15em;border-left-style: solid;"></section> | |
</section> | |
<section style="margin: -1.4em 0.1em; padding: 0.8em; box-sizing: border-box; color: rgb(131, 87, 87); background-color: #f3f3f3;" data-bgless="lighten" data-bglessp="15%"> | |
<section style="color: #595651; font-size: 1em; line-height: 1.4; word-break: break-all; word-wrap: break-word; text-align: left;"> | |
${text} | |
</section> | |
</section> | |
<section style="height: 1.5em; box-sizing: border-box;"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Working Directory" : "\/Users\/vanilla", | |
"Prompt Before Closing 2" : 0, | |
"Selected Text Color" : { | |
"Red Component" : 0.8379544019699097, | |
"Color Space" : "Calibrated", | |
"Blue Component" : 0.8379434943199158, | |
"Alpha Component" : 1, | |
"Green Component" : 0.837929368019104 | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const findServer = require('./find_server'); | |
findServer({ | |
pingKey: 'your pingkey in config.js', | |
port: '3001', | |
path: '/ping', | |
cb: ip => { | |
console.log(ip); | |
}, | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
safe_link(){ | |
local src="$1" | |
local dest="$HOME/`basename $src`" | |
[ ! -e "$dest" ] && ln -sf "$src" "$dest" | |
} | |
DOTFILES="/Users/x/Dropbox/dotfile/dotfiles" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import crop package | |
import crop from 'crop-image'; | |
// input file onChange callback | |
this.upload = e => { | |
const files = e.target.files; | |
if (files && files[0]) { | |
const image = new Image(); | |
image.onload = () => { |