Skip to content

Instantly share code, notes, and snippets.

Jason Williams jasonwilliams

Block or report user

Report or block jasonwilliams

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jasonwilliams
jasonwilliams / gist:4b9c52a0e97072694cb0e2764c12a8d6
Created Jan 25, 2018
VAGRANT_LOG=info vagrant up | portfowarding false
View gist:4b9c52a0e97072694cb0e2764c12a8d6
==> default: Configuring and enabling network interfaces...
INFO ssh: SSH is ready!
INFO ssh: Execute: (sudo=false)
INFO guest: Execute capability: configure_networks [#<Vagrant::Machine: default (VagrantPlugins::ProviderVirtualBox::Provider)>, [{:type=>:static, :adapter_ip=>"192.168.193.1", :ip=>"192.168.193.22", :netmask=>"255.255.255.0", :auto_config=>true, :interface=>0}]] (redhat)
INFO ssh: SSH is ready!
INFO ssh: Execute: (sudo=false)
INFO guest: Execute capability: network_scripts_dir [#<Vagrant::Machine: default (VagrantPlugins::ProviderVirtualBox::Provider)>] (redhat)
INFO ssh: SSH is ready!
INFO ssh: Execute: (sudo=false)
@jasonwilliams
jasonwilliams / gist:2bcc9286fd52518ec4317b33482a1500
Created Jan 25, 2018
`VAGRANT_LOG=info vagrant up` | port forwarding = true
View gist:2bcc9286fd52518ec4317b33482a1500
==> default: Configuring and enabling network interfaces...
INFO ssh: SSH is ready!
INFO ssh: Execute: (sudo=false)
INFO guest: Execute capability: configure_networks [#<Vagrant::Machine: default (VagrantPlugins::ProviderVirtualBox::Provider)>, [{:type=>:static, :adapter_ip=>"192.168.193.1", :ip=>"192.168.193.22", :netmask=>"255.255.255.0", :auto_config=>true, :interface=>0}]] (redhat)
INFO ssh: SSH is ready!
INFO ssh: Execute: (sudo=false)
INFO guest: Execute capability: network_scripts_dir [#<Vagrant::Machine: default (VagrantPlugins::ProviderVirtualBox::Provider)>] (redhat)
INFO ssh: SSH is ready!
INFO ssh: Execute: (sudo=false)
INFO guest: Execute capability: network_interfaces [#<Vagrant::Machine: default (VagrantPlugins::ProviderVirtualBox::Provider)>] (redhat)
View gulpfile.js
'use strict';
const fs = require('fs');
const s3 = require('gulp-s3-upload')();
const log = require('lighthouse-logger');
const gulp = require('gulp');
const config = require('config');
const DateTime = require('luxon').DateTime;
const lighthouse = require('lighthouse');
View lighthouse.js
function generateReport(site, data, type) {
let promise = new Promise((resolve, reject) => {
launchChromeAndRunLighthouse(v.url, {output: type})
.then((data) => {
data = JSON.stringify(data);
// timestamep will be used on the filename
let timeStamp = DateTime.local().toISODate();
// Directory may not exist yet
if (!fs.existsSync(`reports/${v.name}`)) {
View gist:e233ea3e93b19441c3de24fc7af611f4
logs_stats=# \d messages
Table "public.messages"
Column | Type | Modifiers
------------+--------------------------+-------------------------------------------------------
id | integer | not null default nextval('messages_id_seq'::regclass)
user | integer | not null
content | text |
action | action |
timestamp | timestamp with time zone | default now()
channel_id | integer |
View gist:c6727854e0eae1b179cfbe23ed7f4d1b
render_id: 10
player_id: 0
debug: Dropping audio frame which failed decode with timestamp: 1488462617557333 us, duration: 42666 us, packet size: 480 bytes
error: Large timestamp gap detected; may cause AV sync to drift. time:1488462617557333us expected:1488462553599999us delta:63957334us
@jasonwilliams
jasonwilliams / gist:41364a7734eee0ff3b231c530725bc08
Created Feb 16, 2017
[Put in omnibar] Simple script which which updates a number in a <p> on each requestAnimationFrame call - http://codepen.io/jayflux/pen/xgeLjW
View gist:41364a7734eee0ff3b231c530725bc08
data:text/html,<!doctype html><p class="test">0</p><script>var test = document.querySelector('.test'); var count = 0; requestAnimationFrame(function increment() { console.log('test'); test.textContent = ++count; requestAnimationFrame(increment); }); increment();</script>
@jasonwilliams
jasonwilliams / findDomNodeById.js
Last active Jan 4, 2017
My attempt to find a DOM node using a recursive technique, you have to use a recursive pattern
View findDomNodeById.js
function findDomNodeById(root, id, result) {
var result = result || [];
// set base case
if (root.id === id) {
result.push(root);
}
if (root.childNodes.length) {
for (let i = 0; i < root.childNodes.length; i++) {
findDomNodeById(root.childNodes[i], id, result);
@jasonwilliams
jasonwilliams / servers
Last active Dec 12, 2016
~/.subversion/servers
View servers
142 [global]
143 ssl-client-cert-file = /Users/willij87/workspace/certs/dev.bbc.co.uk.p12
144 ssl-client-cert-password = [PASS HERE]
View gist:e38e6a950a988ac6fbfc2e40f15c1902
MC-S104347:servo willij87$ ./mach build --dev
Compiling rustc-demangle v0.1.1
Compiling open v1.1.1
Compiling webrender v0.11.0 (https://github.com/servo/webrender#c4a0c01f)
Compiling string_cache_shared v0.3.0
Compiling fnv v1.0.5
Compiling gcc v0.3.35
Compiling bitflags v0.4.0
Compiling sig v0.1.1
Compiling webrender_traits v0.11.0 (https://github.com/servo/webrender#c4a0c01f)
You can’t perform that action at this time.