Skip to content

Instantly share code, notes, and snippets.

Jason Williams jasonwilliams

View GitHub Profile
@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)
View gist:43fbd42de836160b27b9a47047c09f99
"mod_php70u",
"php70u-cli",
"php70u-common",
"php70u-devel",
"php70u-fpm-httpd",
"php70u-fpm-nginx",
"php70u-fpm",
"php70u-gd",
"php70u-intl",
"php70u-json",
@jasonwilliams
jasonwilliams / quicksort.js
Created Dec 5, 2016
Easier, faster quicksort in javascript
View quicksort.js
// var arr = [1,3,5,2,80,3,71,12];
function sort(arr) {
// base case
if (arr.length <= 1) return arr;
var swapPos = Math.floor((arr.length - 1) / 2),
swapVal = arr[swapPos], less = [], more = [];
arr = arr.slice(0, swapPos).concat(arr.slice(swapPos + 1));
@jasonwilliams
jasonwilliams / test_output
Created Nov 19, 2016
syntax_test_rust.rs failures
View test_output
Packages/sublime-rust/syntax_test_rust.rs:842:31: [source.rust meta.function.rust meta.function.parameters.rust comment.block.rust] does not match scope [source.rust meta.function.rust meta.function.parameters.rust]
Packages/sublime-rust/syntax_test_rust.rs:842:32: [source.rust meta.function.rust meta.function.parameters.rust comment.block.rust] does not match scope [source.rust meta.function.rust meta.function.parameters.rust]
Packages/sublime-rust/syntax_test_rust.rs:842:33: [source.rust meta.function.rust meta.function.parameters.rust comment.block.rust] does not match scope [source.rust meta.function.rust meta.function.parameters.rust]
Packages/sublime-rust/syntax_test_rust.rs:842:34: [source.rust meta.function.rust meta.function.parameters.rust comment.block.rust] does not match scope [source.rust meta.function.rust meta.function.parameters.rust]
Packages/sublime-rust/syntax_test_rust.rs:842:35: [source.rust meta.function.rust meta.function.parameters.rust comment.block.rust] does not match scope [source
View gist:6ff1aa5b2b48fb97f65f4e85f8d94d66
G:\workspace2\sandbox-6-vagrant>vagrant up --debug
INFO global: Vagrant version: 1.8.7
INFO global: Ruby version: 2.2.5
INFO global: RubyGems version: 2.4.5.1
INFO global: VAGRANT_EXECUTABLE="C:\\HashiCorp\\Vagrant\\embedded\\gems\\gems\\vagrant-1.8.7\\bin\\vagrant"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="C:\\HashiCorp\\Vagrant\\embedded"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_INTERNAL_BUNDLERIZED="1"
INFO global: VAGRANT_LOG="debug"
@jasonwilliams
jasonwilliams / Node.sublime-build
Created Oct 31, 2016
add this file to /Users/***/Library/Application Support/Sublime Text 3/Packages/User
View Node.sublime-build
{
"cmd": ["/usr/local/bin/node", "$file"],
"selector": "source.js"
}
View gist:d3bd4bfcf65b08b604b5
$ ./mach run -r -- -b -w --pref dom.mozbrowser.enabled http://localhost:6060
compile "\\\\?\\C:\\msys64\\home\\Jason\\servo\\resources\\shaders\\quad.vs.glsl"
compile "\\\\?\\C:\\msys64\\home\\Jason\\servo\\resources\\shaders\\quad.fs.glsl"
compile "\\\\?\\C:\\msys64\\home\\Jason\\servo\\resources\\shaders\\blit.vs.glsl"
compile "\\\\?\\C:\\msys64\\home\\Jason\\servo\\resources\\shaders\\blit.fs.glsl"
compile "\\\\?\\C:\\msys64\\home\\Jason\\servo\\resources\\shaders\\border.vs.glsl"
compile "\\\\?\\C:\\msys64\\home\\Jason\\servo\\resources\\shaders\\border.fs.glsl"
compile "\\\\?\\C:\\msys64\\home\\Jason\\servo\\resources\\shaders\\blend.vs.glsl"
compile "\\\\?\\C:\\msys64\\home\\Jason\\servo\\resources\\shaders\\blend.fs.glsl"
compile "\\\\?\\C:\\msys64\\home\\Jason\\servo\\resources\\shaders\\filter.vs.glsl"
You can’t perform that action at this time.