Skip to content

Instantly share code, notes, and snippets.

View gmac's full-sized avatar

Greg MacWilliam gmac

View GitHub Profile
@gmac
gmac / bulk_input.jsonl
Created July 26, 2023 20:46
Bulk Input
{ "input": { "handle": "alpha", "descriptionHtml": "alpha", "title": "Alpha" } }
{ "input": { "handle": "bravo", "descriptionHtml": "bravo", "title": "Bravo" } }
{
"MergedSchema": "directive @boundary on OBJECT | FIELD_DEFINITION\ntype Foo @boundary {\n\tid: ID!\n\tgqlgen: Boolean!\n\tnodejs: Boolean!\n}\ntype Query {\n\trandomFoo: Foo!\n}\n",
"Services": [
{
"Name": "gqlgen",
"ServiceURL": "https://localhost:3000",
},
{
"Name": "nodejs",
"ServiceURL": "https://localhost:3001",
@gmac
gmac / entrybody.graphql
Created April 22, 2020 21:48
Chorus EntryBody query
query FetchEntry($uuid: String!) {
entry(uuid: $uuid) {
body {
components {
type
attributes {
alignment
}
...ActionboxAttrs
...BlockquoteAttrs
module.exports = [
{ insert: 'a man ' },
{ insert: 'a plan', attributes: { italic: true } },
{ insert: ' ' },
{ insert: 'panama', attributes: { bold: true } },
{ insert: '\n' },
{ insert: 'hello', attributes: { italic: true } },
{ insert: ' goodbye\n' },
{ insert: 'bold', attributes: { bold: true } },
{ insert: ' ' },
[
{
"type": "EntryBodyParagraphComponent",
"ops": [
{
"insert": "a man ",
"attributes": {}
},
{
"insert": "a plan",
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9">
<url>
<loc>https://revolt.tv/videos/blueface-performs-bleed-strings-attached-003ee507</loc>
<lastmod>2019-05-03</lastmod>
</url>
<url>
<loc>https://revolt.tv/videos/festival-life-scottie-beam-ad-revolt-house-austin-006c3978</loc>
<lastmod>2019-04-01</lastmod>

First, the design system gets broken down into three parts: palette, theme, and config.

Palette

A palette is a set of values that admins can manage directly. Palette fields accept raw input (numbers, hex codes, etc). A palette would look like this:

palette = {
  "color1-faded": "#xxx",
  "color1-light": "#xxx",
document.querySelector('#file-field').addEventListener('change', (evt) => {
uploader.then((evaporate) => {
Array.from(evt.target.files).forEach((file) => {
evaporate.add({
file,
name: file.name,
progress: (progressValue) => console.log('Progress', progressValue),
complete: (_xhr, awsKey) => console.log('Complete!', awsKey),
}).then(
import Evaporate from 'evaporate';
import sparkMD5 from 'spark-md5';
import sha256 from 'js-sha256';
const uploader = Evaporate.create({
signerUrl: '/uploads/auth',
aws_key: 'AWS_PUBLIC_KEY',
bucket: 'your-bucket-name',
cloudfront: true,
computeContentMd5: true,
class UploadsController < ApplicationController
before_action :require_login
def auth
date_stamp = Date.strptime(params[:datetime], "%Y%m%dT%H%M%SZ").strftime("%Y%m%d")
secret_key = "AWS_SECRET_KEY"
aws_region = "us-east-1" # << set to your region
date_key = OpenSSL::HMAC.digest("sha256", "AWS4" + secret_key, date_stamp)
region_key = OpenSSL::HMAC.digest("sha256", date_key, aws_region)