Skip to content

Instantly share code, notes, and snippets.

@chrisvxd
chrisvxd / build-from-yaml.js
Last active November 10, 2020 14:53
Build style-dictionary from YAML config
const YAML = require('yamljs');
const globby = require('globby');
const fs = require('fs-extra');
const path = require('path');
const styleDictionary = require('style-dictionary');
const convertStringValues = obj =>
Object.keys(obj).reduce((acc, key) => {
const item = obj[key];
const hasValueKey = !!item.value;
@chrisvxd
chrisvxd / puppet-master-device-example.js
Last active October 30, 2019 18:26
Puppet Master example for fetching screenshots across devices and writing to a file with device name
const request = require('request');
const fs = require('fs');
const executeRequest = (deviceName) => {
const options = {
url:
'https://api.saasify.sh/1/call/transitive-bullshit/puppet-master@a818aeac/screenshot',
qs: {
url: 'https://google.com',
emulateDevice: deviceName
@chrisvxd
chrisvxd / ApolloFormik.tsx
Last active December 6, 2018 20:47
ApolloFormik component, for building typed Formik forms that mutate GraphQL via Apollo
import * as React from 'react';
import { Mutation, ApolloConsumer } from 'react-apollo';
import { ApolloClient } from 'apollo-client';
import { Formik, FormikProps, Form } from 'formik';
import { DocumentNode } from 'graphql';
interface ApolloFormProps<T> {
afterSubmit?: (values: T) => void;
children: (formikBag: FormikProps<T>) => React.ReactNode;
initialValues: T;