Twemoji + React
A dead simple React Twemoji component.
twemoji
Requirements: npm install --save twemoji
{ | |
"name": "workshop-computer-validator", | |
"version": "1.0.0", | |
"description": "I use this to validate people's computers have the proper versions of node and npm installed for a workshop", | |
"bin": "./validate-system.js", | |
"dependencies": { | |
"semver": "7.1.3" | |
} | |
} |
import useSWR from '@zeit/swr'; | |
import localForage from 'localforage'; | |
import { ConfigInterface } from '@zeit/swr/dist/src/types'; | |
import { useState, useEffect } from 'react'; | |
export function usePersistentSWR(key: string, fn?: Function, config?: ConfigInterface) { | |
let handleSuccess; | |
if (config !== undefined && config.onSuccess !== undefined) { | |
const { onSuccess } = config; | |
handleSuccess = (data: any, key: string, config: ConfigInterface) => { |
import { ApolloServer, gql } from 'apollo-server-micro'; | |
const typeDefs = gql` | |
type Query { | |
sayHello: String | |
} | |
`; | |
const resolvers = { | |
Query: { |
A dead simple React Twemoji component.
twemoji
npm install --save twemoji
function onFormSubmit(e) { | |
var form = FormApp.openById('1Z65umQSZ2drz3MvTWCWlwP4-ySeoB5D7RvX1LtusnEU'); | |
var formResponses = form.getResponses(); | |
var latestResponse = formResponses.length - 1; | |
var formResponse = formResponses[latestResponse]; | |
var email = formResponse.getRespondentEmail(); | |
var items = formResponse.getItemResponses(); |
#!/bin/bash | |
for file in $(./ipfs refs local); | |
do | |
if ! [[ $(./ipfs cat "$file" 2>&1 >/dev/null | grep 'Error') ]] ; then | |
if ! [[ $(./ipfs cat "$file" | file - | grep ': data') ]] ; then | |
printf "=== LOCAL FILE FOUND ===\n\n" | |
echo $file | |
./ipfs cat "$file" | file - | |
printf "\n\n" |
With a single import _ "net/http/pprof"
you can add profiling endpoints to a
HTTP server.
package main
import (
"fmt"
// Package main is a sample macOS-app-bundling program to demonstrate how to | |
// automate the process described in this tutorial: | |
// | |
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5 | |
// | |
// Bundling the .app is the first thing it does, and creating the DMG is the | |
// second. Making the DMG is optional, and is only done if you provide | |
// the template DMG file, which you have to create beforehand. | |
// | |
// Example use: |
#!/bin/sh | |
# add this to your bitbar directory | |
# don't forget to chmod +x | |
# width and characters for the progress bars | |
# feel free to configure these | |
width=30 | |
fill_char="█" | |
empty_char="▁" |
This is a proof-of-concept of a graphical editor that allows you to to edit a Graphviz graph graphically, by drawing edges between nodes and inserting new nodes by using the mouse only. It also allows you to edit the textual DOT language description and directly see the graph transform itself into a new layout in an animated transition.
The GUI editor is perfectly usable as it is, but it has some simplifications that needs to be addressed in a production quality application in order not to hamper productivity:
Help is available by clicking the question mark in the top right corner.
This sma