Skip to content

Instantly share code, notes, and snippets.

View amattn's full-sized avatar

Matt Nunogawa @amattn amattn

View GitHub Profile
[Adblock Plus 2.0]
! Title: Misc Widgets
*ko-fi.com/*
*jsdelivr.net/npm/cookieconsent*
https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js
*blogger.com/*comment_from_post_iframe.js
*blogger.com/*widgets.js
*sharethis.com/*
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";
@layer utilities {
.fgoto {
/* don't use this with <sup>... one or the other.*/
font-size: 75%; line-height: 0; position: relative; vertical-align: baseline;
top: -0.3em; vertical-align: super;
}
@amattn
amattn / input.css
Created January 28, 2021 17:48
Tailwind input.css file which supports sup and sub tags. see: https://amattn.com/p/brief_history_of_and_advanced_tricks_with_tailwind_css.html
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";
/* I mostly use this for math like exponents and stuff */
sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; }
sup { top: -0.3em; vertical-align: super;}
sub { bottom: -0.25em; vertical-align: sub;}
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";
/* Works on Firefox */
pre {
scrollbar-color: #6B7280 #1f2937;
}
/* Works on Chrome, Edge, and Safari */
// https://tailwindcss.com/docs/customizing-colors#color-palette-reference
const colors = require('tailwindcss/colors')
const round = (num) =>
num
.toFixed(7)
.replace(/(\.[0-9]+?)0+$/, '$1')
.replace(/\.0$/, '')
const rem = (px) => `${round(px / 16)}rem`
const em = (px, base) => `${round(px / base)}em`
def generate_html_for_route(route_path) do
conn = Phoenix.ConnTest.build_conn()
conn = get(conn, route_path)
resp = html_response(conn, 200)
priv_static_path =
Path.join([
:code.priv_dir(:dash_home),
"static",
route_path
@amattn
amattn / Dockerfile
Created January 6, 2021 17:44
Dockerfile example used to build an elixir/phoenix project on linux and output a tarball
FROM elixir:1.11.2 AS build
## instll some dependencies (webpack basically)
RUN \
apt-get update -y && \
curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
apt-get install -y nodejs && node -v && npm -v
# Required environment variables passed in via --build-arg flags
@amattn
amattn / deploy.sh
Last active September 9, 2023 05:41
#!/bin/sh
set -o nounset
set -o errexit
usage(){
echo "Usage: $0 X.Y.Z dev|test|staging|prod"
echo ""
echo "example: ./deploy.sh 1.1.3 prod"
echo "example: ./deploy.sh 1.2.0 dev"

Keybase proof

I hereby claim:

  • I am amattn on github.
  • I am amattn (https://keybase.io/amattn) on keybase.
  • I have the public key with fingerprint A9AD 6782 656D 3E83 C67B  8B56 DFDA DA1B 1538 2CEB

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am amattn on github.
  • I am amattn (https://keybase.io/amattn) on keybase.
  • I have the public key with fingerprint A9AD 6782 656D 3E83 C67B  8B56 DFDA DA1B 1538 2CEB

To claim this, I am signing this object: