Skip to content

Instantly share code, notes, and snippets.

Avatar

Logan Volkers loganvolkers

View GitHub Profile
@loganvolkers
loganvolkers / ScriptTracker.ts
Last active Nov 19, 2020
Use `script` elements for web components. Inspired by @polymer/marked-element
View ScriptTracker.ts
import { getElement } from '@stencil/core';
export type ScriptTrackerProps = {
element: any;
updater: (value: unknown) => unknown;
onError?: (e: Error) => unknown;
};
export class ScriptTracker {
/**
View ExampleHook.ts
import { Component, h } from '@stencil/core';
import { useState } from 'haunted';
import { useHook } from './stencil-hooks';
@Component({
tag: 'example-hook',
})
export class ExampleHook {
render = useHook(this, () => {
@loganvolkers
loganvolkers / ConsumerExample.ts
Last active Sep 15, 2020
Context for Stencil
View ConsumerExample.ts
@Component({
tag: 'stencil-consumer',
})
export class StencilConsumer {
@Prop() renderer: any;
@State() context: Record<string, any>;
componentWillLoad(){
console.log("Will load")
}
@loganvolkers
loganvolkers / Byte Formatting for Google Sheets.md
Last active Jan 11, 2021
Byte formatting for Google Sheets
View Byte Formatting for Google Sheets.md
View Widget API Definition.js
/**
* Widget <> Squatch.js Interface via EasyXDM
*/
init(height, width, codeIn, rewardBalance, resizeEmbedToContentIn)
resize(height, width)
publish(eventName, payload)
close()
error(errorMessage, height, width)
@loganvolkers
loganvolkers / Auth0Mailchimp.js
Last active Sep 8, 2016
Auth0 Custom Connection Script
View Auth0Mailchimp.js
function doAuth(access_token, ctx, callback) {
var opts = {
'headers': {
'Authorization': 'OAuth ' + access_token,
'Accept': 'application/json',
'User-Agent': 'Auth0'
}
};
request.get('https://login.mailchimp.com/oauth2/metadata', opts, function(e, r, b) {
View components.login-button.js
import Ember from 'ember';
export default Ember.Component.extend({
backendService: Ember.inject.service('backend-service'),
actions: {
login() {
this.get('backendService').login();
},
query() {
this.get('backendService').query();
You can’t perform that action at this time.