Skip to content

Instantly share code, notes, and snippets.

@dhritzkiv
dhritzkiv / response.json
Created June 28, 2016 16:57
QBO ExchangeRate Query Response
{
"Fault": {
"Error": [
{
"Message": "An application error has occurred while processing your request",
"Detail": "System Failure Error: An unexpected error occurred while accessing or saving your data. Please wait a few minutes and try again. If the problem persists, contact customer support.",
"code": "10000"
}
],
"type": "SystemFault"
@dhritzkiv
dhritzkiv / .jscrc
Created December 11, 2015 16:29
jcsrc for debugging --fix
{
"excludeFiles": ["node_modules/**"],
"esnext": true,
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
@dhritzkiv
dhritzkiv / index.js
Created August 19, 2015 19:53
requirebin sketch
var sync = require("ampersand-sync");
var xhr = require("xhr");
var options = {
url: 'http://jsonplaceholder.typicode.com/posts',//a test endpoint
headers: {
"Content-Type": "application/json"
},
json: {
foo: "bar"
@dhritzkiv
dhritzkiv / index.js
Created July 31, 2015 20:30
requirebin sketch
var rfc6902 = require("rfc6902");
var starting = {
arr: []
};
var goal = {
arr: [1,2,3,4,5,6]
};
var diff = rfc6902.createPatch(starting, goal);
@dhritzkiv
dhritzkiv / index.js
Created July 21, 2015 22:15
requirebin sketch
var View = require("ampersand-view");
var CustomView = View.extend({
initialize: function() {
this.on("remove", function() {
this.el.innerHTML = "I was removed??"
});
}
});
@dhritzkiv
dhritzkiv / gist:210976f47e8e9722a5a9
Last active October 2, 2015 05:55
Chaining an arbitrary number of node.js Streams
//readStream is a readable input stream;
//writeStream is a writable output stream; and
//transformStreamsArray is a predefined array with an arbitrary number of transform streams;
transformStreamsArray
.reduce((previousStream, thisStream) => previousStream.pipe(thisStream), readStream)
.pipe(writeStream);
@dhritzkiv
dhritzkiv / index.js
Created June 29, 2015 20:01
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var AmpersandFormView = require("ampersand-form-view");
var AmpersandInputView = require("ampersand-input-view");
var FormView = AmpersandFormView.extend({
fields: function() {
return [
new AmpersandInputView({
@dhritzkiv
dhritzkiv / index.js
Created May 31, 2015 23:42
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var WebFont = require("webfontloader");
WebFont.load({
typekit: {
id: 'ttn1lqr'
},
timeout: 1
@dhritzkiv
dhritzkiv / index.js
Created May 26, 2015 00:12
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var WebFont = require("webfontloader");
WebFont.load({
typekit: {
id: 'xxxxx',
},
timeout: 3000,
@dhritzkiv
dhritzkiv / index.js
Last active August 29, 2015 14:18
ampersand-select-view in ampersand-form-view@2.x
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var FormView = require("ampersand-form-view");
var InputView = require("ampersand-input-view");
var SelectView = require("ampersand-select-view");
var Form = FormView.extend({
fields: function() {