国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
| // Mobile project scss utils. | |
| // https://gist.github.com/overtrue/56561fd4b124b9ffe5048ef06752d4bf | |
| // Space | |
| // | |
| $spacer: 12px !default; | |
| @each $prop, $abbrev in (margin: m, padding: p) { | |
| @for $size from 0 to 10 { | |
| $value: #{$size * $spacer}; |
| //Shashank Duhan 2017 | CC.0 | |
| //You gonna need reflex.js for this : | |
| // https://gist.github.com/shashankduhan/673a4e1223afe550ca69958bcb73181c | |
| window.router = (()=>{ | |
| "use strict" | |
| return { | |
| state: 0, | |
| init: function(user){ | |
| router.routes = router.state; | |
| window.addEventListener("hashchange", router.router); |
| const http = require('http') | |
| const url = require('url') | |
| const path = require('path') | |
| const fs = require('fs') | |
| const mime = { | |
| "html": "text/html", | |
| "css": "text/css", | |
| "js": "text/javascript", | |
| "json": "application/json", | |
| "gif": "image/gif", |
| var Ajax = (function() { | |
| var methodsList = ['get', 'post', 'head', 'options', 'put', 'connect', 'trace', 'delete']; | |
| /** | |
| * Ajax | |
| * @param {String} url | |
| * @param {Function} callback | |
| * @param {Object/String} data | |
| * @param {Object} options | |
| * |
| /* | |
| * Code snippet for posting tweets to your own twitter account from node.js. | |
| * You must first create an app through twitter, grab the apps key/secret, | |
| * and generate your access token/secret (should be same page that you get the | |
| * app key/secret). | |
| * Uses oauth package found below: | |
| * https://github.com/ciaranj/node-oauth | |
| * npm install oauth | |
| * For additional usage beyond status updates, refer to twitter api | |
| * https://dev.twitter.com/docs/api/1.1 |
| var DOMTokenListSupports = function(tokenList, token) { | |
| if (!tokenList || !tokenList.supports) { | |
| return; | |
| } | |
| try { | |
| return tokenList.supports(token); | |
| } catch (e) { | |
| if (e instanceof TypeError) { | |
| console.log("The DOMTokenList doesn't have a supported tokens list"); | |
| } else { |
| // Get all users | |
| var url = "http://localhost:8080/api/v1/users"; | |
| var xhr = new XMLHttpRequest() | |
| xhr.open('GET', url, true) | |
| xhr.onload = function () { | |
| var users = JSON.parse(xhr.responseText); | |
| if (xhr.readyState == 4 && xhr.status == "200") { | |
| console.table(users); | |
| } else { | |
| console.error(users); |
| let isFunction = function(obj) { | |
| return typeof obj == 'function' || false; | |
| }; | |
| class EventEmitter { | |
| constructor() { | |
| this.listeners = new Map(); | |
| } | |
| addListener(label, callback) { | |
| this.listeners.has(label) || this.listeners.set(label, []); |