Skip to content

Instantly share code, notes, and snippets.

View leomelzer's full-sized avatar

Leonhard Melzer leomelzer

View GitHub Profile
leomelzer / .zshrc
Created March 11, 2023 21:07
My .zshrc
eval "$(fnm env --use-on-cd)"
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
if type brew &>/dev/null
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
leomelzer / package.json
Created August 2, 2022 13:05
Send in Blue Wrapper Example
"name": "send-in-blue-wrapper",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"keywords": [],
"author": "",
leomelzer / index.ts
Created February 2, 2021 17:59
Set SVG dimensions in GraphCMS
import fetch from "node-fetch";
import imageSize from "image-size";
import { GraphQLClient, gql } from "graphql-request";
const ENDPOINT =
const TOKEN =
type Asset = Record<"id" | "handle" | "url", string> &
leomelzer / input.story.js
Created November 7, 2019 08:54
$ jscodeshift -t renameDefaultStory.js **/*.story.js
export const defaultStory = () => <StatusDot />;
leomelzer / input.story.js
Last active November 7, 2019 08:55
$ jscodeshift -t removeStoryConfig.js **/*.story.js
export const usePlaceholder = () => (
<TextField placeholder="I am a placeholder" />
usePlaceholder.story = {
name: 'use placeholder'
Option Description
version We'll use the (current) version 2 of the Now platform. Version 1 will be deprecated in the future but is still fully supported. Since the platform versions are based on different concepts, the specific options are different, too.
name The name of the application, usually the same as in package.json. This will be used as a label in the Now UI to identify the application.
alias This is the default argument for the now alias command. The alias will point to the randomly generated subdomain where Now created your immutable deployment. You must add the domain to Now in order to use this feature. You may add multiple aliases and also use subdomains here (e.g. if you already added the domain to Now).
builds A Now application may be deployed using any of the available builders such as for Node.js, Go, Python and so on. We'll use the `static-buil
leomelzer / main.workflow
Created January 8, 2019 09:29
The textual representation of the workflow, `main.workflow`.
workflow "Deploy to Now" {
on = "push"
resolves = [
"Filter out master branch",
action "Deploy" {
uses = "actions/zeit-now@master"
leomelzer / package.json
Created January 8, 2019 09:28
Simplified package.json with the added now-build script.
"name": "jetztein",
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"now-build": "npm run build && mv build dist"
leomelzer / now.json
Created January 8, 2019 09:27
now.json file with routing rules for a Create-React-App.
"version": 2,
"name": "jetztein",
"alias": "",
"builds": [{ "src": "package.json", "use": "@now/static-build" }],
"regions": ["bru"],
"routes": [
{ "src": "^/static/(.*)", "dest": "/static/$1" },
{ "src": "^/favicon.ico", "dest": "/favicon.ico" },
{ "src": "^/asset-manifest.json", "dest": "/asset-manifest.json" },
leomelzer / Dockerfile
Last active March 9, 2022 19:18
Install private NPM dependencies using git+ssh on Now. Based on to work around missing support for git+ssh dependencies in now@2 (
# This is a multi-stage build to not spill the contents of the deploy_key
FROM mhart/alpine-node:10 as base
# We need git and openssh to resolve `git+ssh` links in package.json
RUN apk update \
&& apk add git openssh
WORKDIR /usr/src
COPY package*.json ./