Skip to content

Instantly share code, notes, and snippets.

View shellsong's full-sized avatar

shellsong

  • beijing
View GitHub Profile
function plus(n,r){
var result = r||0;
result+=n;
function add(n){
return plus(n,result)
}
add.toString = function(){
return result;
}
return add;
body{
font-family: 'Helvetica Neue', "Microsoft YaHei", "微软雅黑", SimSun, "宋体", Heiti, "黑体",Helvetica, Arial, Verdana, sans-serif;
}
@shellsong
shellsong / gcd.js
Created November 7, 2014 12:47
greatest common divisor
function gcd(a,b){
return b>0?gcd(b,a%b):a;
}
@shellsong
shellsong / effector.js
Created October 10, 2015 10:29
effector
'use strict'
import {
EventEmitter
} from 'events'
const keyRegExp = /\{(\w+)\}/g
const sep = '.'
@shellsong
shellsong / url.re
Last active November 17, 2015 09:44
"^(?:([A-Za-z]+):)?(\\/{0,3})([0-9.\\-A-Za-z]+)(?::(\\d+))?(?:\\/([^?#]*))?(?:\\?([^#]*))?(?:\\?([^#]*))?(?:#(.*))?$"
@shellsong
shellsong / YCombinator.js
Last active February 20, 2019 14:42
YCombinator
module.exports = (le) => ((f) => f(f))((f) => le((x) => (f(f))(x)))
@shellsong
shellsong / suncalc.js
Created February 1, 2019 03:26
计算天文时间
const J1970 = 2440588
const J2000 = 2451545
const deg2rad = Math.PI / 180
const M0 = 357.5291 * deg2rad
const M1 = 0.98560028 * deg2rad
const J0 = 0.0009
const J1 = 0.0053
const J2 = -0.0069
const C1 = 1.9148 * deg2rad
const C2 = 0.0200 * deg2rad
https://github.com/zhangzhixin00/Robot
# %%
import scipy as sp
from scipy.signal import argrelextrema
import numpy as np
import pandas as pd
import tushare as ts
from bokeh.io import output_notebook, show
from bokeh.plotting import figure
output_notebook()