Skip to content

Instantly share code, notes, and snippets.

View kwhinnery's full-sized avatar

Kevin Whinnery kwhinnery

View GitHub Profile
@kwhinnery
kwhinnery / three-equal-signs.json
Created December 8, 2022 16:46
Example app for 12 Days of Retool day 3!
{"uuid":"095e511a-7703-11ed-aa54-7b1e6d7a8632","page":{"id":112160021,"data":{"appState":"[\"~#iR\",[\"^ \",\"n\",\"appTemplate\",\"v\",[\"^ \",\"isFetching\",false,\"plugins\",[\"~#iOM\",[\"$main\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"$main\",\"type\",\"frame\",\"subtype\",\"Frame\",\"namespace\",null,\"resourceName\",null,\"resourceDisplayName\",null,\"template\",[\"^3\",[\"type\",\"main\",\"sticky\",false]],\"style\",[\"^3\",[]],\"position2\",null,\"mobilePosition2\",null,\"mobileAppPosition\",null,\"tabIndex\",null,\"container\",\"\",\"createdAt\",\"~m1670509044651\",\"updatedAt\",\"~m1670509044651\",\"folder\",\"\",\"screen\",null]]],\"$header\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"$header\",\"^4\",\"frame\",\"^5\",\"Frame\",\"^6\",null,\"^7\",null,\"^8\",null,\"^9\",[\"^3\",[\"type\",\"header\",\"sticky\",true,\"isHiddenOnDesktop\",false,\"isHiddenOnMobile\",true]],\"^:\",[\"^3\",[]],\"^;\",null,\"^<\",null,\"^=\",null,\"^>\",null,\"^?\",\"\",\"^@\",
@kwhinnery
kwhinnery / tuple-hacks.json
Created December 7, 2022 22:56
12 Days of Retool Day 2 - Two Tuple Hacks
{"uuid":"791b2f6a-7658-11ed-ad25-bf29ecc70af5","page":{"id":111979449,"data":{"appState":"[\"~#iR\",[\"^ \",\"n\",\"appTemplate\",\"v\",[\"^ \",\"isFetching\",false,\"plugins\",[\"~#iOM\",[\"query1\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"query1\",\"type\",\"datasource\",\"subtype\",\"SqlQueryUnified\",\"namespace\",null,\"resourceName\",\"onboarding_db\",\"resourceDisplayName\",\"onboarding_db\",\"template\",[\"^3\",[\"queryRefreshTime\",\"\",\"records\",\"\",\"lastReceivedFromResourceAt\",null,\"databasePasswordOverride\",\"\",\"queryDisabledMessage\",\"\",\"servedFromCache\",false,\"successMessage\",\"\",\"queryDisabled\",\"\",\"playgroundQuerySaveId\",\"latest\",\"resourceNameOverride\",\"\",\"runWhenModelUpdates\",true,\"showFailureToaster\",true,\"query\",\"select * from products;\",\"playgroundQueryUuid\",\"\",\"playgroundQueryId\",null,\"error\",null,\"privateParams\",[\"~#iL\",[]],\"runWhenPageLoadsDelay\",\"\",\"data\",null,\"recordId\",\"\",\"importedQueryInputs\",[\"^3\",[
@kwhinnery
kwhinnery / ast-parser.json
Created December 7, 2022 17:29
AST Parser for the 12 Days of Retool!
{"uuid":"31a3f5d8-71c4-11ed-8183-8776d1b9fed0","page":{"id":111885406,"data":{"appState":"[\"~#iR\",[\"^ \",\"n\",\"appTemplate\",\"v\",[\"^ \",\"isFetching\",false,\"plugins\",[\"~#iOM\",[\"$main\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"$main\",\"type\",\"frame\",\"subtype\",\"Frame\",\"namespace\",null,\"resourceName\",null,\"resourceDisplayName\",null,\"template\",[\"^3\",[\"type\",\"main\",\"sticky\",false]],\"style\",[\"^3\",[]],\"position2\",null,\"mobilePosition2\",null,\"mobileAppPosition\",null,\"tabIndex\",null,\"container\",\"\",\"createdAt\",\"~m1669932298426\",\"updatedAt\",\"~m1669932298426\",\"folder\",\"\",\"screen\",null]]],\"$header\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"$header\",\"^4\",\"frame\",\"^5\",\"Frame\",\"^6\",null,\"^7\",null,\"^8\",null,\"^9\",[\"^3\",[\"type\",\"header\",\"sticky\",true,\"isHiddenOnDesktop\",false,\"isHiddenOnMobile\",true]],\"^:\",[\"^3\",[]],\"^;\",null,\"^<\",null,\"^=\",null,\"^>\",null,\"^?\",\"\",\"^@\",
@kwhinnery
kwhinnery / collapsible-sidebar-custom-content.json
Last active December 6, 2022 15:00
Sidebar example apps for Retool's new Sidebar Frame!
{"uuid":"e6e7af38-7571-11ed-a323-bbecb9cda24b","page":{"id":111530760,"data":{"appState":"[\"~#iR\",[\"^ \",\"n\",\"appTemplate\",\"v\",[\"^ \",\"isFetching\",false,\"plugins\",[\"~#iOM\",[\"query1\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"query1\",\"type\",\"datasource\",\"subtype\",\"RESTQuery\",\"namespace\",null,\"resourceName\",\"REST-WithoutResource\",\"resourceDisplayName\",null,\"template\",[\"^3\",[\"queryRefreshTime\",\"\",\"paginationLimit\",\"\",\"body\",\"\",\"lastReceivedFromResourceAt\",null,\"queryDisabledMessage\",\"\",\"servedFromCache\",false,\"successMessage\",\"\",\"queryDisabled\",\"\",\"playgroundQuerySaveId\",\"latest\",\"resourceNameOverride\",\"\",\"runWhenModelUpdates\",true,\"paginationPaginationField\",\"\",\"headers\",\"\",\"showFailureToaster\",true,\"paginationEnabled\",false,\"query\",\"https://gist.githubusercontent.com/kwhinnery/86061b6d83c1e91757de00122ea39962/raw/3ccb075c72cfe38f15408bf61e078de87d55de69/data.json\",\"playgroundQueryUuid\",\"\",\"pla
@kwhinnery
kwhinnery / main.js
Last active October 21, 2022 16:05
const path = require('path');
const { app, BrowserWindow } = require('electron');
function createWindow() {
const win = new BrowserWindow({
width: 1280,
height: 720,
webPreferences: {
preload: path.join(__dirname, 'preload.js')
}
@kwhinnery
kwhinnery / dndtool.json
Last active September 22, 2022 01:16
Work in progress D&D Tools built in Retool (https://www.retool.com)
{"uuid":"6aca7a34-392b-11ed-bd49-8bb70f5219e2","page":{"id":95557202,"data":{"appState":"[\"~#iR\",[\"^ \",\"n\",\"appTemplate\",\"v\",[\"^ \",\"isFetching\",false,\"plugins\",[\"~#iOM\",[\"resetDiceRoll\",[\"^0\",[\"^ \",\"n\",\"pluginTemplate\",\"v\",[\"^ \",\"id\",\"resetDiceRoll\",\"type\",\"datasource\",\"subtype\",\"JavascriptQuery\",\"namespace\",null,\"resourceName\",\"JavascriptQuery\",\"resourceDisplayName\",null,\"template\",[\"^3\",[\"queryRefreshTime\",\"\",\"lastReceivedFromResourceAt\",null,\"queryDisabledMessage\",\"\",\"successMessage\",\"\",\"queryDisabled\",\"\",\"playgroundQuerySaveId\",\"latest\",\"resourceNameOverride\",\"\",\"runWhenModelUpdates\",false,\"showFailureToaster\",true,\"query\",\"lastDiceClicked.setValue(-1);\\ndiceRolls.setValue([]);\\ndiceRollModifier.setValue(0);\\ndiceRollDisplay.setValue(`<small><i>Roll a die...</i></small>`);\\ndiceRollTotal.setValue(`## 0`);\\n\",\"playgroundQueryUuid\",\"\",\"playgroundQueryId\",null,\"error\",null,\"privateParams\",[\"~#iL\",[]],\"
@kwhinnery
kwhinnery / ClientOnly.js
Last active November 20, 2021 16:00
SSR pattern
import React from 'react';
const SSR = typeof window === 'undefined';
function _ClientOnly() {
return(
<div style={{
backgroundColor: localStorage.getItem('backgroundColor')
}}/>
);
const http = require('http');
const express = require('express');
const bodyParser = require('body-parser');
const MessagingResponse = require('twilio').twiml.MessagingResponse;
const app = express();
app.use(bodyParser.urlencoded({ extended: false });
app.post('/sms', (req, res) => {
const twiml = new MessagingResponse();
{
"name": "Kevin's Mod",
"version": "0.1.x",
"dependencies": {
"twilio": "4.x"
},
"engines": {
"twilioquest": "3.1.x"
},
"twilioquest": {
app.post('/message', function(req, res, next) {
// Use the REST client to send a text message
client.messages.create({
to: req.body.to,
from: TWILIO_PHONE_NUMBER,
body: 'Good luck on your Twilio quest!'
}).then(function(message) {
// When we get a response from Twilio, respond to the HTTP POST request
res.send('Message is inbound!');
}).catch(function(error) {