Skip to content

Instantly share code, notes, and snippets.

axios.post('/query/download', {
familyId: this.item.id,
queryName: 'test',
columnNames : this.columnNames
})
.then(function(response) {
let blob = new Blob([response.data], { type: 'text/csv' } )
let link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
link.download = 'test.csv'
@xmas
xmas / formatjson.js
Created June 26, 2017 22:12 — forked from kristopherjohnson/formatjson.js
Read JSON from standard input and writes formatted JSON to standard output. Requires Node.js.
#!/usr/bin/env node
// Reads JSON from stdin and writes equivalent
// nicely-formatted JSON to stdout.
var stdin = process.stdin,
stdout = process.stdout,
inputChunks = [];
stdin.resume();
@xmas
xmas / App
Created November 29, 2016 03:24
Vue localForage plugin and associated helpers
const app = new Vue({
store,
mounted : function () {
const warmCache = 1000 * 60 * 15;
for (var i = 0; i < rezza_providers.length; i++) {
let provider = rezza_providers[i];
let now = new Date();
localforage.getItem(provider.dbKey+'.updated')
/*!
* Chart.js
* http://chartjs.org/
* Version: 2.1.6
*
* Copyright 2016 Nick Downie
* Released under the MIT license
* https://github.com/chartjs/Chart.js/blob/master/LICENSE.md
*/
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Chart=t()}}(function(){return function t(e,a,i){function n(r,l){if(!a[r]){if(!e[r]){var s="function"==typeof require&&require;if(!l&&s)return s(r,!0);if(o)return o(r,!0);var d=new Error("Cannot find module '"+r+"'");throw d.code="MODULE_NOT_FOUND",d}var u=a[r]={exports:{}};e[r][0].call(u.exports,function(t){var a=e[r][1][t];return n(a?a:t)},u,u.exports,t,e,a,i)}return a[r].exports}for(var o="function"==typeof require&&require,r=0;r<i.length;r++)n(i[r]);return n}({1:[function(t,e,a){},{}],2:[function(t,e,a){function i(t){if(t){var e=/^#([a-fA-F0-9]{3})$/,a=/^#([a-
@xmas
xmas / NavEvent.evt
Created March 29, 2016 20:27
Lighting Nav Controller Example
<aura:event type="APPLICATION">
<aura:attribute name="direction" type="String"/>
<aura:attribute name="type" type="String"/>
<aura:attribute name="params" type="String"/>
</aura:event>
<aura:component implements="flexipage:availableForAllPageTypes" controller="InsightNavController">
<ltng:require styles="/resource/SLDS0122/assets/styles/salesforce-lightning-design-system-ltng.css,/resource/jquery_ui_css" scripts="/resource/jquery_js,/resource/jquery_ui_js" />
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:attribute name="typedata" type="List" />
<aura:attribute name="reports" type="List" />
@xmas
xmas / AsyncReportController.cls
Created January 15, 2016 05:48 — forked from peterknolle/AsyncReportController.cls
Asynchronous Reports with the Analytics API in Apex
public with sharing class AsyncReportController {
public List<SelectOption> availableReports { get; set; }
public Id reportId { get; set; }
public Id instanceId { get; set; }
public Boolean reportIsRunning { get; set; }
private transient Reports.ReportResults reportResults;
public AsyncReportController() {
availableReports = retrieveAvailableReports();
@xmas
xmas / AccountContactApp.app
Created January 6, 2016 21:05
Parent Child Parameter Passing
<aura:application >
<c:AccountParentComponent/>
</aura:application>