This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var istanbul = require('gulp-istanbul'); | |
var mocha = require('gulp-mocha'); | |
gulp.task('test', function (cb) { | |
gulp.src(['lib/**/*.js', 'web.js', 'api.js']) | |
.pipe(istanbul()) // Covering files | |
.on('finish', function () { | |
gulp.src(['test/**/*.js']) | |
.pipe(mocha()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const co = require('co'); | |
const Benchmark = require('benchmark'); | |
function asyncOp () { | |
return new Promise((fulfill, reject) => { | |
fulfill('ok'); | |
}); | |
} | |
function yieldAction () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect } from "react" | |
/** | |
* This hook takes an element and ensures that it does not go outside the bounds of the viewport. It is useful | |
* for things like a context menu where you don't want the menu to appear off screen. | |
* | |
* The only requriements for the DOM reference passed in is that it is absolutely positioned. | |
* To prevent it flickering in the original place and then moving with the correction, set the visibility CSS attribute | |
* of the DOM element to 'hidden'. This hook will set it to 'visible' when it has computed the corrected position | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"Styled Component": { | |
"scope": "javascript", | |
"prefix": [ | |
"styled", | |
"styled-component" | |
], | |
"body": [ | |
"import React from \"react\"", | |
"import PropTypes from \"prop-types\"", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: "v1" | |
kind: "Service" | |
metadata: | |
name: "nginx-hello-world" | |
labels: | |
app: "hello-world" | |
annotations: | |
load-balancer.hetzner.cloud/name: "devopslb" | |
load-balancer.hetzner.cloud/health-check-port: "10254" |