Skip to content

Instantly share code, notes, and snippets.

// Relic integration point
/**
* Create a transactional scope in which instrumentation that will only add
* trace segments to existing transactions will funciton.
*
* @param Agent agent The agent whose tracer should be used to create the
* transaction.
* @param Function callback The function to be run within the transaction.
*/
@dasher
dasher / test.js
Last active December 17, 2015 19:09
Nested Policy Support Allows a policySet to be created that depends on a number of factors - in the current state this allows the path & the controller::action to define the policy set - it also allows the target of the policy to be either the policy file (the existing sails policy system) or a controller::action
'use strict';
var _ = require('lodash');
_.string = require("underscore.string");
// enhance the console a little
require("consoleplusplus");
// Timestamps not needed
console.disableTimestamp();
// Mock
var txId = "TheTXIdGoesHere";
$.getJSON('http://blockchain.info/tx-index/'+txId+'?format=json',
function(data) {
console.log(JSON.stringify(data));
}
);
@dasher
dasher / hickHack.js
Last active August 29, 2015 14:22
Gitter Desktop App for testing the API
var dummyHandle = function() {
// Just here to help with debugging if its needed
//console.log(arguments);
}
var fetchAttibuteByName = function(element, name, regex) {
// Fetch a named attribute from a DOM element - passing in the element, the attribute name
// and an optional regex to parse the attribute name by
if (Array.isArray(element)) {
<picture>
<!-- serve WebP to Chrome and Opera -->
<source
media="(min-width: 50em)"
sizes="50vw"
srcset="/image/thing-200.webp 200w, /image/thing-400.webp 400w,
/image/thing-800.webp 800w, /image/thing-1200.webp 1200w,
/image/thing-1600.webp 1600w, /image/thing-2000.webp 2000w"
type="image/webp">
<source