Skip to content

Instantly share code, notes, and snippets.

View aidanlister's full-sized avatar

Aidan Lister aidanlister

View GitHub Profile
@aidanlister
aidanlister / bi-dashboard.js
Created September 13, 2020 00:58
A react component for embedding sisense where you have a tenant-per-subdomain multitenancy architecture
import React, { useRef } from 'react'
import PropTypes from 'prop-types'
const BI_BASE_URL = 'https://sisense.onuptick.com'
const BIDashboard = ({ defaultDashboard, jwt }) => {
// This component creates an iframe element setting the initial src to log the user in via a JWT
// once that load has finished, the onLoad handler is called (loadDashboard). This then
// hands over to the SiSense API to initialise the iframe and complete the embedding.
const src = BI_BASE_URL + '/jwt?jwt=' + jwt
const iFrameElement = useRef(null)
@aidanlister
aidanlister / bi-dashboard.js
Created September 13, 2020 00:58
A react component for embedding SiSense
import React, { useRef } from 'react'
import PropTypes from 'prop-types'
const BI_BASE_URL = 'https://sisense.onuptick.com'
const BIDashboard = ({ defaultDashboard, jwt }) => {
// This component creates an iframe element setting the initial src to log the user in via a JWT
// once that load has finished, the onLoad handler is called (loadDashboard). This then
// hands over to the SiSense API to initialise the iframe and complete the embedding.
const src = BI_BASE_URL + '/jwt?jwt=' + jwt
const iFrameElement = useRef(null)
@aidanlister
aidanlister / 0_reuse_code.js
Created June 3, 2017 23:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@aidanlister
aidanlister / jquery.stickytabs.js
Created February 1, 2015 10:27
Remember tab on init
/**
* jQuery Plugin: Sticky Tabs
*
* @author Aidan Lister <aidan@php.net>
* @version 1.2.0
*/
(function ( $ ) {
$.fn.stickyTabs = function( options ) {
var context = this