Skip to content

Instantly share code, notes, and snippets.

View earnubs's full-sized avatar

Stephen Stewart earnubs

View GitHub Profile
@earnubs
earnubs / yui-config
Created September 20, 2012 13:29
YUI config
YUI({
comboBase: '/yui3?',
combine: true,
root: 'build/',
groups: {
contrib: {
comboBase: '/yui3-contrib?',
combine: true,
// explicitly list the modules and deps, this improves combohandler bundling of
// script requests
@earnubs
earnubs / index.html
Created October 25, 2012 11:09
YUI Panels
<!doctype html>
<html>
<head>
<meta charset=utf-8>
<script src="http://yui.yahooapis.com/3.7.2/build/yui/yui-min.js"></script>
<script src=panels.js></script>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.7.3/build/cssreset/cssreset-min.css">
<link rel="stylesheet" type="text/css" href="panels.css">
<title>YUI Panels</title>
@earnubs
earnubs / dial.js
Created November 24, 2012 00:10
iplayer radio
YUI().use('node', 'event-move', 'event-touch', function(Y) {
// TODO key shortcuts, up, down, left, right, hjkl?
// TODO gestures
var dial = Y.one('.dial'),
viewer = Y.one('.viewer ul'),
origin = dial.getXY(),
rotation = 0,
last = {},
mass = 300, // 345 is close to 1:1 at edge
@earnubs
earnubs / .bashrc
Last active July 28, 2016 15:10
PS1 with node version
PS1='\[\e]0;\w\a\]\[\n\]\[\e[32m\]\u@\h: \[\e[33m\]\[\w\]\[\e[0m\]\[\n\][node \[\e[0;36m\]$(node -v)\[\e[m]\] \$ '
@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
},
@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 / 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);
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 / 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 / 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