Skip to content

Instantly share code, notes, and snippets.

View adamrights's full-sized avatar

Adam Bedell adamrights

View GitHub Profile
@adamrights
adamrights / wsjhpkeyvalue.log
Created June 29, 2018 05:03
Console Exploration of WSJ HP KEY/VALUE Cache Storage
This file has been truncated, but you can view the full file.
Resource interpreted as Document but transferred with MIME type application/json: "https://pub.wsjprod-hp.grand-canyon.virginia.dj01.onservo.com/debug/pe?length".
Navigated to https://pub.wsjprod-hp.grand-canyon.virginia.dj01.onservo.com/debug/pe?length
fetch("https://pub.wsjprod-hp.grand-canyon.virginia.dj01.onservo.com/debug/pe?length", {"credentials":"include","headers":{},"referrerPolicy":"no-referrer-when-downgrade","body":null,"method":"GET","mode":"cors"});
Promise {<pending>}
fetch("https://pub.wsjprod-hp.grand-canyon.virginia.dj01.onservo.com/debug/pe?length", {"credentials":"include","headers":{},"referrerPolicy":"no-referrer-when-downgrade","body":null,"method":"GET","mode":"cors"}).then((r)=>response.json((data)=>console.log(data))
VM64826:1 Uncaught SyntaxError: missing ) after argument list
fetch("https://pub.wsjprod-hp.grand-canyon.virginia.dj01.onservo.com/debug/pe?length", {"credentials":"include","headers":{},"referrerPolicy":"no-referrer-when-downgrade","body":null,"method":"GET","mode":"co
/**
* requireModuleInit.js
* Initialize require modules on article pages
*
* TODO: Move config into separate files - separate based on dev config and prod config
*/
require.config({
enforceDefine: true,
map: {
@adamrights
adamrights / 0_reuse_code.js
Created September 23, 2015 19:38
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
/**
* Should be in the head to prevent FOUT on subsequent page views.
* http://crocodillon.com/blog/non-blocking-web-fonts-using-localstorage
*
* Make sure to edit md5 and path to your fonts json!
*/
(function(window, document) {
'use strict';
var isModernBrowser = (
<html>
<head>
<title>OboeJS demo</title>
<script src="https://rawgit.com/jimhigson/oboe.js/v2.1.2/dist/oboe-browser.min.js"></script>
</head>
<body>
<div ></div>
<ul id="content">
<li>AUD_CAD:</li>
</ul>
@adamrights
adamrights / test.html
Last active August 26, 2015 02:16 — forked from xmlking/test.html
Demonstrate streaming JSON data parsing with OboeJS lib. Client consuming streaming REST endpoint implemented using NodeJS/RxJava/Ratpack etc and -chunked transfer- encoding
<html>
<head>
<title>OboeJS demo</title>
<script src="https://rawgit.com/jimhigson/oboe.js/v2.1.2/dist/oboe-browser.min.js"></script>
</head>
<body>
<div ></div>
<ul id="content">
<li>AUD_CAD:</li>
</ul>
@adamrights
adamrights / Enum.es6.js
Last active August 26, 2015 02:14 — forked from xmlking/Enum.es6.js
JavaScript Enums with ES6, Type Checking and Immutability
export class EnumSymbol {
sym = Symbol.for(name);
value: number;
description: string;
constructor(name: string, {value, description}) {
if(!Object.is(value, undefined)) this.value = value;
if(description) this.description = description;
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
#!/bin/bash
# CentOS rbenv system wide installation script
# Forked from https://gist.github.com/1237417
# Installs rbenv system wide on CentOS 5/6, also allows single user installs.
# Install pre-requirements
yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel \
make bzip2 autoconf automake libtool bison iconv-devel git-core
module.exports = function(config) {
config.set({
frameworks: ['browserify', 'mocha', 'chai'],
//specify browserify preproccesor so we can use server-side components
preprocessors: {
'test/*' : ['browserify']
},