This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This test ensures there is no render gap between when a page is published and made available. | |
// Specifically we expect to get a 200 response (vs 404) immediately, within milliseconds, after a page is published. | |
// We will prove this by making a request to site-engine every X milliseconds and then triggering a publish | |
// At no time should we recieve a 404 response | |
const ZESTY_INSTANCE_DOMAIN = "http://zesty.pw/"; | |
const ZESTY_USER_EMAIL = ""; | |
const ZESTY_USER_PASSWORD = ""; | |
const ZESTY_INSTANCE_ZUID = "8-f48cf3a682-7fthvk"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function ($) { | |
/* <a> TAG TRACKER | |
* @Version: 0.0.2 | |
* @Author: Stuart Runyan | |
* @Documentation: http://code.google.com/apis/analytics/docs/tracking/eventTrackerGuide.html | |
* @trackList: Add all domains that you want to track as "internal". | |
* Allow regular expressions | |
* It is not neccessary to include the domain this code resides on. | |
* If the active domain is include in the list there are checks to insure | |
* we don't double track. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Returns an Array of all url parameters | |
* @return {[Array]} [Key Value pairs form URL] | |
*/ | |
function getAllUrlParams() { | |
var keyPairs = [], | |
params = window.location.search.substring(1).split('&'); | |
for (var i = params.length - 1; i >= 0; i--) { | |
keyPairs.push(params[i].split('=')); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puppeteer = require('puppeteer') | |
const express = require('express') | |
const querystring = require('querystring') | |
const server = express() | |
/** | |
* Screenshot a url | |
* e.g. /screenshot?url=https://www.npmjs.com&width=800&height=600 | |
*/ | |
server.get('/screenshot', async (req, res) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @see https://strongloop.com/strongblog/modular-node-js-express/ | |
var fs = require('fs') | |
var resolve = require('path').resolve | |
var join = require('path').join | |
var cp = require('child_process') | |
// get library path | |
var src = resolve(__dirname, '../src/') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import './app.tag' | |
riot.mount('#app', 'app') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
var http = require('http') | |
var request = require('request') | |
var gm = require('gm') | |
var fs = require('fs') | |
var FormData = require('form-data') | |
let r1 = request('https://upload.wikimedia.org/wikipedia/commons/e/eb/Ash_Tree_-_geograph.org.uk_-_590710.jpg') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
import stream from 'stream' | |
export default function sniff(rs, sniffLength = 16384) { | |
return new Promise((resolve, reject) => { | |
let buffer = Buffer.from([]) | |
let ws = new stream.Writable() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="/" method="post" name="newsletter"> | |
<input type="text" name="first_name" value="stuart" /> | |
<input type="file" id="resume" /> | |
<input type="hidden" id="dropbox" /> | |
<input type="hidden" name="zlf" value="1" /> | |
<button type="submit">Submit</button> | |
</form> | |
<script> | |
document.forms.newsletter.addEventListener('submit', function cb(evt) { | |
evt.preventDefault() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const koa = require('koa') | |
const r = require('koa-route') | |
const https = require('https') | |
const app = koa() | |
app.use(r.get('/search/:term', function *(term) { | |
const req = https.request({ | |
method: 'get', |
NewerOlder