Skip to content

Instantly share code, notes, and snippets.

View earnubs's full-sized avatar

Stephen Stewart earnubs

View GitHub Profile
@earnubs
earnubs / rg-to-trello.js
Created May 14, 2018 09:10
Send rg results to Trello lane
#!/usr/bin/env node
const readline = require('readline');
const request = require('request');
const RateLimiter = require('limiter').RateLimiter;
const limiter = new RateLimiter(5, 'second');
const TRELLO_KEY = process.env.TRELLO_KEY;
const TRELLO_TOKEN = process.env.TRELLO_TOKEN;
@earnubs
earnubs / .vimrc
Last active February 5, 2019 14:49
set expandtab
set shiftwidth=2
set softtabstop=2
set nu
set path+=**
set clipboard=unnamed
set wildignore+=.git,.DS_Store
set statusline+=%F
set backspace=indent,eol,start
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script>delete window.fetch;</script>
<script src="https://cdn.rawgit.com/zloirock/core-js/master/client/shim.min.js"></script>
@earnubs
earnubs / Makefile
Last active October 4, 2017 12:00
node6 sunos node-sass pkg
# $NetBSD$
PORTNAME= node-sass
PORTVERSION= 4.5.3
DISTNAME= v${PORTVERSION}
PKGNAME= node6-sass-binding-${DISTNAME}
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
CATEGORIES= meta-pkgs
MASTER_SITES= ${MASTER_SITE_GITHUB:=sass/}
USE_TOOLS+= gmake
@earnubs
earnubs / simple-mocha-reporter.js
Created March 31, 2017 15:20
mocha reporter without the solarized colour mayhem
var mocha = require('mocha');
module.exports = MyReporter;
function MyReporter(runner) {
mocha.reporters.Base.call(this, runner);
var passes = 0;
var failures = 0;
runner.on('pass', function(test){
passes++;
@earnubs
earnubs / index.js
Created February 10, 2017 21:40
HMR with reach-hot-loader3 and webpack 2
import { AppContainer } from 'react-hot-loader';
import React from 'react';
import { Provider } from 'react-redux';
import { createStore } from 'redux';
import { render } from 'react-dom';
import App from './containers/app';
import reducers from './reducers';
// Grab the state from a global variable injected into the server-generated HTML
vila@saw:~/u1/ols-vms/exp/doc 0 :) $ ./ols-vms2 help
Available Topics:
vm
==
vm.setup_scripts: A list of scripts to be executed on the guest to finalize the setup.
The scripts are executed over ssh, in the user home directory.
Scripts can use config options from their vm, they will be expanded before
upload.
@earnubs
earnubs / selenium-webdriver-proxy-browserstack.md
Last active January 19, 2017 12:20
Browserstack selenium-webdriver within a proxied environment

If you are running selenium-webdriver within an environment that requires an HTTPS proxy to connect to the outside world in order to drive your tests, such as when using the Browserstack webdriver hub, then you may need to configure a webdriver proxy with an HTTP CONNECT tunnelling httpAgent, like so:

import { Builder } from 'selenium-webdriver';
import { httpsOverHttp } from 'tunnel-agent';
import url from 'url';

# other stuff ...
const proxyUrl = url.parse(process.env.HTTP_PROXY);
@earnubs
earnubs / squid.conf
Created January 13, 2017 11:14
squid config jenkaas
# Allow br0
acl br0 src 192.168.234.140/16
# Allow br1
acl br1 src 172.16.183.160/16
# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
#http_access allow localnet
http_access allow localhost
@earnubs
earnubs / dev.js
Last active November 16, 2016 21:44
custom webpack logger (talisker)
webpackApp.use(webpackDevMiddleware(compiler, {
contentBase: webpackDevUrl.href,
quiet: false,
hot: true,
noInfo: false,
stats: {
colors: false,
chunks: false,
children: false
},