Skip to content

Instantly share code, notes, and snippets.

@radio-alice
radio-alice / shadows.js
Last active January 19, 2020 03:16
script for making fun text shadows that respond to the mouse as if it were a light source
// script for making fun text shadows that respond to the mouse as if it were a light source
// by Zach (zach@anemon.es)
// do whatever you want with this
// make sure the element's width and height are only as big as the text
// (e.g. width: max-content)
// include like <head>... <script src="/path/to/shadows.js"></script> </head>
// check out demo usage here => https://github.com/radio-alice/anemon.es/blob/fern/index.js#L3
const getElementLocation = element => {
@radio-alice
radio-alice / quasar.js
Last active October 30, 2019 16:07
examples of how to use the quasar api to pin files via http endpoints and ethereum smart contracts
const quasarUrl = 'http://quasar.yourdomain.com' // wherever you are hosting the server
// tell quasar to listen for pin events from a smart contract at contractAddress
async function addStorageContract(contractAddress) {
return await fetch(`${quasarUrl}/api/v0/contracts`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ contractAddress })
const pinataAuthUrl = `https://api.pinata.cloud/data/testAuthentication`
const temporalAuthUrl = `https://api.temporal.cloud/v2/auth/login`
export const storeInCache = (wrapper, key, value) => {
return wrapper.cache.set(key, value)
}
export const getFromCache = (wrapper, key) => {
return wrapper.cache.observe(key)
}
import ipfsClient from 'ipfs-http-client'
const username = 'zach'
const password = '[ the password ]'
const temporalAuthUrl = `https://api.temporal.cloud/v2/auth/login`
// this is working now!
const init = async () => {
const auth = await fetch(temporalAuthUrl, {
method: 'POST',

Keybase proof

I hereby claim:

  • I am radio-alice on github.
  • I am zach_sherman (https://keybase.io/zach_sherman) on keybase.
  • I have a public key ASDKod1kYjAu7AXAyFjJR_3VIVtk_YWoAnfc4gtqD1MKGgo

To claim this, I am signing this object:

@radio-alice
radio-alice / README.md
Created February 17, 2019 17:26
SCRIPT-8
@radio-alice
radio-alice / README.md
Created February 17, 2019 17:24
SCRIPT-8