Skip to content

Instantly share code, notes, and snippets.

View dangreen's full-sized avatar
💭
🦄

Dan Onoshko dangreen

💭
🦄
View GitHub Profile

50 runs on each configuration

Regular network:

No DSL:

Average time: 1s 511ms
Fastest time: 1s 266ms
Slowest time: 2s 925ms
@dangreen
dangreen / .travis.yml
Created September 7, 2019 04:16
Publish artifacts from travis-ci
language: node_js
node_js:
- "lts/*"
cache:
directories:
- node_modules
after_script:
# - npx jest -u
- node scripts/artifacts test/__image_snapshots__
import EventEmitter from 'events';
const emitter = new EventEmitter();
const app = {
done() {
console.log('done');
}
};
emitter.on('action', () => {
#!/usr/bin/env node
const Microphone = require('node-microphone');
// echo test: ./mic.js | ./speaker.js
const mic = new Microphone({
channels: 2, // 1 for echo test
rate: 44100 // 16000 for echo test
});
import {
Readable,
Writeable
} from 'stream';
export interface IOptions {
host: string;
port?: number;
username: string;
password: string;
@dangreen
dangreen / critical-css.html
Last active March 16, 2017 03:48
Critical CSS + Progressive CSS
<!DOCTYPE html>
<html>
<head>
<script>
// https://github.com/filamentgroup/loadCSS/blob/master/src/loadCSS.js
</script>
<style>
/* Стили для хедера сайта, плюс: */
.main-article,
.comments,
@dangreen
dangreen / vh-omnibox-workaround.js
Last active March 16, 2017 03:59
vh css unit with mobile omibox workaround
import $ from 'jquery';
const isMobile = /Android|iPad|iPhone|iPod/.test(navigator.userAgent),
$window = $(window),
resizers = [];
if (isMobile) {
let oldHeight = $window.height(),
oldWidth = $window.width();