via: Computer-Science-Glossary
| 英文 | 译法 1 | 译法 2 | 译法 3 |
|---|---|---|---|
| a block of pointers | 一块指针 | 一组指针 | |
| abbreviation | 缩略语 |
via: Computer-Science-Glossary
| 英文 | 译法 1 | 译法 2 | 译法 3 |
|---|---|---|---|
| a block of pointers | 一块指针 | 一组指针 | |
| abbreviation | 缩略语 |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| <style id="jsbin-css"> | |
| .circle_process{ | |
| position: relative; | |
| width: 200px; |
| // 来源: https://smallpath.me/post/blog-vuex-wheel | |
| const global = typeof window !== 'undefined' ? window : process | |
| class Store { | |
| constructor({ | |
| state, | |
| actions, | |
| mutations, | |
| getters | |
| }) { |
| <div class="loading"> | |
| <div> | |
| <div class="circle"> | |
| </div> | |
| </div> | |
| </div> | |
| .loading{ |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| <style id="jsbin-css"> | |
| div{ | |
| border:1px solid red; | |
| width: 30px; |
| function matchesSelector(el, selector) { | |
| var p = Element.prototype; | |
| var f = p.matches || p.webkitMatchesSelector || p.mozMatchesSelector || p.msMatchesSelector || function(s) { | |
| return [].indexOf.call(document.querySelectorAll(s), this) !== -1; | |
| }; | |
| return f.call(el, selector); | |
| } | |
| // 用法 | |
| matchesSelector(document.getElementById('myDiv'), 'div.someSelector[some-attribute=true]') |
| /* | |
| * 0x1ad2 base Gulp.js file | |
| * https://twitter.com/0x1ad2 | |
| */ | |
| /* | |
| * Define plugins | |
| */ | |
| var gulp = require('gulp'); | |
| var $ = require('gulp-load-plugins')(); |
| // 来源 http://laker.me/blog/2015/10/10/15_1010_rgb_hex_color/ | |
| var hexToRgb = function(hex) { | |
| var rgb = []; | |
| hex = hex.substr(1);//去除前缀 # 号 | |
| if (hex.length === 3) { // 处理 "#abc" 成 "#aabbcc" | |
| hex = hex.replace(/(.)/g, '$1$1'); | |
| } |
| // convert 0..255 R,G,B values to binary string | |
| RGBToBin = function(r,g,b){ | |
| var bin = r << 16 | g << 8 | b; | |
| return (function(h){ | |
| return new Array(25-h.length).join("0")+h | |
| })(bin.toString(2)) | |
| } | |
| // convert 0..255 R,G,B values to a hexidecimal color string | |
| RGBToHex = function(r,g,b){ |
| // 来源 http://laker.me/blog/2015/10/10/15_1010_rgb_hex_color/ | |
| var rgbToHex = function(rgb) { | |
| // rgb(x, y, z) | |
| var color = rgb.toString().match(/\d+/g); // 把 x,y,z 推送到 color 数组里 | |
| var hex = "#"; | |
| for (var i = 0; i < 3; i++) { | |
| // 'Number.toString(16)' 是JS默认能实现转换成16进制数的方法. | |
| // 'color[i]' 是数组,要转换成字符串. | |
| // 如果结果是一位数,就在前面补零。例如: A变成0A |