Skip to content

Instantly share code, notes, and snippets.

View ohcrfpv's full-sized avatar
🏠
Working from home

蒲公英の生活 ohcrfpv

🏠
Working from home
View GitHub Profile
@ohcrfpv
ohcrfpv / base10to26.py
Last active September 24, 2015 05:23
python converter 10 to 26
# -*- coding: utf-8 -*-
'''
copyright: (c) 2015 by fewspider([email protected]).
~~~~~~~~~
converter 10 to 26,like:
1 -> A
2 -> B
27 -> AA
~~~~~~~~~
test it:
@ohcrfpv
ohcrfpv / isIntNumber.js
Last active November 4, 2015 18:42
javascript check int number
function isIntNumber(value) {
var numberRe = /^-?[0-9]+$/;
return typeof(value) === 'number' && numberRe.test(value);
}
@ohcrfpv
ohcrfpv / git-basic-usage.md
Last active December 4, 2018 02:13
git基本用法

git clone [email protected]:fewspider/client-1.git 克隆一个项目到本地,默认路径是git项目的地址

git status 查看当前分支的状态

git add . 添加当前的修改

git commit -m 'update' 记录一个修改

git push origin master 提交当前所有修改到远程master分支

@ohcrfpv
ohcrfpv / underscorejs-basic-usage.md
Last active December 4, 2018 02:13
underscorejs基本用法

字典转数组

var dct = {
  a: 1,
  b: 2,
  c: 3
};

var list = _.map(_.pairs(dct), (item)=> {
 return {
@ohcrfpv
ohcrfpv / request.js
Last active December 4, 2018 02:36
通用请求类
import 'whatwg-fetch';
import queryString from 'query-string';
import { fetchMessage, fetchRootDomain } from './helper';
import { toast } from 'react-toastify';
export default class Request {
constructor(token) {
this.baseUrl = fetchRootDomain() + '/';
this.token = token;
}
@ohcrfpv
ohcrfpv / format.js
Last active December 19, 2018 08:14
三目运算符避免不正确的数据
var data = {
a: {
b: ''
},
d: '0',
dct: {
'0': 'aaaa',
'1': 'bbbb'
}
}
@ohcrfpv
ohcrfpv / test.js
Last active April 22, 2019 09:20
js 递归函数 获取json
function fetchLast(obj, strs) {
// 1
// obj = a
// strs = ['b', 'c', 'd']
// 2
// obj = a['b']
// strs = ['c', 'd']
// 3
@ohcrfpv
ohcrfpv / page.md
Last active August 26, 2019 06:53
page logic

小于等于页数7

  • 页数 5 1 2 3 4 5
  • 页数 6 1 2 3 4 5 6
  • 页数 7 1 2 3 4 5 6 7

大于页数7

示例一 (页数能整除

@ohcrfpv
ohcrfpv / compliments.json
Last active July 1, 2021 10:11
compliments.json
{
"anytime":[
"abandon [ə'bændən] vt. 放弃,沉溺n. 放任",
"abashed [ə'bæʃt] adj. 1 (在人前) 感觉羞愧的,局促不安的,困窘的; 2. [因…]局促不安的",
"abate [ə'beit] vt. 缓和,减弱,减少,废除vi. 缓和,减弱,减少",
"abdicate [æbdi'keit] vt. 放弃vi. 逊位",
"abduct [æb'dʌkt] vt. 诱拐,绑走",
"abhor [əb'hɔ:] vt. 憎恶,痛恨",
"abhorrent [əb'hɔrənt] a. 令人憎恨的,可恶的,不一致的,相反的,厌恶的",
"ability [ə'biliti] n. 能力,才干",
@ohcrfpv
ohcrfpv / gist:b02e4583278c3c16fc104754a1275b2b
Last active October 19, 2023 12:13
hdzero-tiny-whoop-osd.md
set osd_warn_bitmask = 34813
set osd_link_quality_pos = 2578
set osd_rssi_dbm_pos = 2586
set osd_tim_2_pos = 3084
set osd_flymode_pos = 2048
set osd_throttle_pos = 2487
set osd_warnings_pos = 14880
set osd_avg_cell_voltage_pos = 3619
set osd_pit_ang_pos = 2610
set osd_rol_ang_pos = 2618