Skip to content

Instantly share code, notes, and snippets.

View ibeeger's full-sized avatar
🐮
coding

邯 xiaohan.cui ibeeger

🐮
coding
View GitHub Profile
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
@ibeeger
ibeeger / chrome SpeechRecognition API.md
Last active February 7, 2019 11:24
chrome SpeechRecognition API
  • 首先要注意 会调用 MediaDevices.getUserMedia 获取权限 也就是说必须在https下 或则 localhost下。

  • recognition.lang 设置语言 通过 speechSynthesis.getVoices() 获得所支持的语言列表,

  • 识别率较高,成本低

  • 目前兼容性并不高,虽然2012年推出的规范,但目前只有部分浏览器支持。

以下是demo代码,可以尝试下。

@ibeeger
ibeeger / video.md
Last active July 3, 2018 03:36
video标签属性

video的属性

 
 <video
  id="video" 
  src="video.mp4" 
  controls = "true"
  poster="images.jpg" /*视频封面*/
  preload="auto" 
 webkit-playsinline="true" /*这个属性是ios 10中设置可以
@ibeeger
ibeeger / service worker.md
Last active June 22, 2018 08:59
个人理解

service worker能干什么

  1. 缓存文件
  2. 离线工作 可能对h5小游戏来说更有价值吧(个人见解,想象空间还是蛮大的,可以看)

工作流程

  1. 安装 install 安装过程中会把提前设置的资源地址缓存到用户端
  2. 激活 activte 每次激活会对比缓存的版本信息,如果不同会删除 当前版本的缓存信息
  3. 过滤 用户端请求地址的时候 如果资源地址在缓存列表内就可以直接从缓存去,直接减少请求。
@ibeeger
ibeeger / npm_module.md
Last active June 13, 2018 06:18
一些积累的npm模块

通用类

@ibeeger
ibeeger / colors.js
Created June 12, 2018 03:32
判断两色素颜色的相似度
var Distance = 150; //设置阀值 结果和该值比较,如果小于它就代表相似
//color1 = {r:xxx,b:xxx,g:xxx};
function Compared(color1,color2){
let _liked = false;
let _r = color1.r-color2.r;
let _g = color1.g-color2.g;
let _b = color1.b-color2.b;
if(Math.sqrt(Math.pow(_r,2)+Math.pow(_g,2)+Math.pow(_g,2))<Distance){
@ibeeger
ibeeger / imageMagick.md
Last active June 8, 2018 08:05
imagemagic 使用

字体

convert -list font //查看安装的字体

./etc/ImageMagick-7/type-apple.xml 添加字体

<type

format="ttf"

@ibeeger
ibeeger / itterm.md
Created May 25, 2018 11:44
it专业术语

一、发展背景

  • Web1.0:门户时代,网页信息展示,用户很少产生数据,如搜狐新浪。
  • Web2.0:社交时代,人人产生内容,如微博。
  • Web3.0:物联网时代,用互联网连接物品,感知世界。
  • 移动互联网:移动通信与互联网相结合,使得移动终端能够使用互联网。
  • 互联网+:将互联网的创新成果融入实体经济社会各领域之中。

二、基本概念

互联网思维:这个词解释起来很危险……好吧,它是互联网时代思维方式的集合,如免费、用户体验、参与感等。

公共属性

  • x
  • y
  • width
  • height

svg

@ibeeger
ibeeger / es6import.md
Last active May 25, 2018 11:38
es6import

export

基本的两种用法:

export function foo() {
// ..
}
export var awesome = 42;
var bar = [1,2,3];