This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
| def Secured[A](username: String, password: String)(action: Action[A]) = Action(action.parser) { request => | |
| request.headers.get("Authorization").flatMap { authorization => | |
| authorization.split(" ").drop(1).headOption.filter { encoded => | |
| new String(org.apache.commons.codec.binary.Base64.decodeBase64(encoded.getBytes)).split(":").toList match { | |
| case u :: p :: Nil if u == username && password == p => true | |
| case _ => false | |
| } | |
| }.map(_ => action(request)) | |
| }.getOrElse { | |
| Unauthorized.withHeaders("WWW-Authenticate" -> """Basic realm="Secured"""") |
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
| // Takes a URL, param name, and data string | |
| // Sends to the server.. The server can respond with binary data to download | |
| jQuery.download = function(url, key, data){ | |
| // Build a form | |
| var form = $('<form></form>').attr('action', url).attr('method', 'post'); | |
| // Add the one key/value | |
| form.append($("<input></input>").attr('type', 'hidden').attr('name', key).attr('value', data)); | |
| //send request | |
| form.appendTo('body').submit().remove(); |
The spec has moved to a repo: https://github.com/defunctzombie/package-browser-field-spec to facilitate collaboration.
| 'use strict'; | |
| // 1. Create the file: {projectRoot}/test.js | |
| // 2. Install dependencies: npm i glob why-is-node-running | |
| // 3. Run the tests: node --expose-internals test.js | |
| const whyIsNodeRunning = require('why-is-node-running'); | |
| const glob = require('glob'); | |
| const Mocha = require('mocha'); |
| go test -v -race -coverprofile=coverage.txt -covermode=atomic ./... && go tool cover -html=coverage.txt |
We're currently working on making it easier to add new field types to KeystoneJS as plugins.
In the meantime, if you'd like to work on your own field type, hopefully this guide will point you in the right direction.
Keystone fields require the following:
{fieldType}.js file in ./lib/fieldTypes that controls the field and encapsulates options support, underscore functions, validation and updating{fieldType}.js file needs to be included by ./lib/fieldTypes/index.js| // Any copyright is dedicated to the Public Domain. | |
| // http://creativecommons.org/publicdomain/zero/1.0/ | |
| process.on('message', function(msg) { | |
| console.log('reply'); | |
| process.send(msg); | |
| }); | |
| process.ref(); |
| var lru = require('lru-cache') | |
| , couchwatch = require('couchwatch') | |
| , request = require('request') | |
| ; | |
| function RegistryCache () { | |
| this.cache = lru() | |
| this.watch = couchwatch('http://isaacs.iriscouch.com/registry', -1) | |
| this.watch.on('row', function (change) { | |
| this.cache.del(change.id) |