Skip to content

Instantly share code, notes, and snippets.

View tannerhallman's full-sized avatar
💭
cheeky

Tanner Hallman tannerhallman

💭
cheeky
View GitHub Profile
#!/bin/bash
# We don't need return codes for "$(command)", only stdout is needed.
# Allow `[[ -n "$(command)" ]]`, `func "$(command)"`, pipes, etc.
# shellcheck disable=SC2312
set -u
abort() {
printf "%s\n" "$@" >&2
@tannerhallman
tannerhallman / Theme.js
Created August 20, 2021 19:11
A sample Theme.js for coworks-web-components library
/* eslint-disable id-length */
import { ColorLuminance } from '../components/Util/Colors/ColorUtils'
import colors from '../components/Util/Colors/colors'
import designTokens from './designTokens'
export const lightTheme = {
name: 'light',
backgroundColor: '#fff', //storybook background color
colors: {
@tannerhallman
tannerhallman / designTokens.js
Created August 20, 2021 19:09
A sample ZeroHeight design token export
/* eslint-disable id-length */
const designTokens = {
colors: {
accent1: '#25af7f',
accent2: '#3283c4',
accent3: '#7635e2',
accent4: '#9a3dc5',
accent5: '#c24378',
accent6: '#e18736',
boxShadow: '#ffffff',
@tannerhallman
tannerhallman / devise_token_auth_to.js
Last active July 27, 2019 03:25
Rails devise_token_auth recreated in javascript so our rails monolith can have authenticates JS microservices 👍. I pulled ruby code straight out of the devise_token_auth methods. Hope this saves you the hours it took me. :)
const bcrypt = require("bcrypt"); //package.json -- "bcrypt": "^3.0.6", ruby's gem version -> devise_token_auth (0.1.42)
// async function main() {
// // Create a new user called `Alice`
// //const newUser = await prisma.createUser({ name: 'Alice' })
// //console.log(`Created new user: ${newUser.name} (ID: ${newUser.id})`)
// // Read all users from the database and print them to the console
// //const allUsers = await prisma.users()
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Next: Chrome",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
},