Skip to content

Instantly share code, notes, and snippets.

const io = require('socket.io')();
const middleware = require('socketio-wildcard')();
io.use(middleware);
const client = require('socket.io-client');
io.on('connection', function(socket) {
console.log(`connection`);
socket.upstream = client('http://127.0.0.1:8000');
const ciInfo = jest.genMockFromModule(`ci-info`)
ciInfo.isCI = true
ciInfo.name = `bad default`
function setName(name) {
ciInfo.name = name
}
ciInfo.setName = setName
module.exports = ciInfo
const fetch = require('@zeit/fetch-cached-dns')(require('node-fetch'));
const {RateLimit} = require(`async-sema`);
const lim = new RateLimit(50);
module.exports = function getPost(SEGMENT_API_SECRET, s) {
return async function post(events) {
await lim();
const res = await fetch(`https://api.segment.io/v1/batch`, {
method: 'post',
body: JSON.stringify({batch: events}),
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/lib/node_modules/npm/bin/npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'my-demo-postinstall-plugin@1.0.0',
1 verbose cli '--global',
1 verbose cli '--prefix',
1 verbose cli '/root/.npm/_npx/7',
1 verbose cli '--loglevel',
1 verbose cli 'error',
#!/usr/bin/env node
console.log(`my demo postinstall index is here`);
package main
import (
"bufio"
"encoding/json"
"flag"
"fmt"
"os"
"strings"
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
2017-01-08T00:00:00.000Z;1
2017-01-15T00:00:00.000Z;3
2017-01-22T00:00:00.000Z;3
2017-01-29T00:00:00.000Z;4
2017-02-05T00:00:00.000Z;4
2017-02-12T00:00:00.000Z;6
2017-02-19T00:00:00.000Z;7
2017-02-26T00:00:00.000Z;10
2017-03-05T00:00:00.000Z;10
2017-03-12T00:00:00.000Z;11
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.5 (Ubuntu 10.5-1.pgdg16.04+1)
-- Dumped by pg_dump version 10.5 (Ubuntu 10.5-1.pgdg16.04+1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
#!/bin/bash
plot() {
key=$1
files=$(ls ./work/$key* | awk '{ split($0, ar, " "); printf("%s ", ar[1] ) }')
gnuplot -e "set timefmt '%Y-%m-%d-%H-%M'; set terminal svg size 1280,500 fname 'Verdana' fsize 10; set xdata time; set datafile sep ','; set key noenhanced ; files=\"$files \"; plot for [file in files] file using 1:2 w lines title substr(file, 8, 200)"
}
pods=($(kubectl get pods --no-headers -l app=now-proxy-production | awk '{ split($0, ar, " "); print(ar[1]) }'))