Skip to content

Instantly share code, notes, and snippets.

View amattn's full-sized avatar

Matt Nunogawa @amattn amattn

View GitHub Profile
@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"
[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/*
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
@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;
}
// 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`
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";
/* Works on Firefox */
pre {
scrollbar-color: #6B7280 #1f2937;
}
/* Works on Chrome, Edge, and Safari */
@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;}
@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 / automatedBuildAndUploadToTestflight.sh
Created April 17, 2012 23:24
Automated Xcode build and upload to TestFlight.
#!/bin/sh
# Current as working as of 2012/4/17
# Xcode 4.3.2
PROJECT_ROOT="$HOME/SomeDirWhereYourProjectLives/XXXXXXXX"
WORKSPACE="$PROJECT_ROOT/XXXXXXXX.xcodeproj/project.xcworkspace"
CONFIG="AdHoc"
SCHEME="XXXXXXXX"
@amattn
amattn / riak.go
Created September 10, 2012 17:58
Rough draft of a golang Riak driver
// Package riak is an opinionated driver for the Riak datastore
// Developed against Riak 1.2
//
// Design decisions were made to prioritize safety over absolute ease of use.
// This is a work in progress, but could be good starting point for your own custom driver
// Eventually, there will be a real repo.
// Also on the roadmap is protocol buffer support, multi-node clusters, better sibling
// resolution and even client-side CRDTs
//
// If you have any feedback, please let me know.