Skip to content

Instantly share code, notes, and snippets.

View denielchiang's full-sized avatar
🕵️‍♂️
Working from home

Deniel Chiang denielchiang

🕵️‍♂️
Working from home
View GitHub Profile
@denielchiang
denielchiang / app.js
Created January 19, 2021 07:09 — forked from goofansu/app.js
LiveView upload directly to AWS China S3
let Uploaders = {}
Uploaders.S3 = function (entries, onViewError) {
entries.forEach(entry => {
let xhr = new XMLHttpRequest()
onViewError(() => xhr.abort())
xhr.onload = () => (xhr.status === 200 ? entry.done() : entry.error())
xhr.onerror = () => entry.error()
xhr.upload.addEventListener("progress", event => {
if (event.lengthComputable) {
@denielchiang
denielchiang / tailwind.config.js
Created February 13, 2020 05:28 — forked from cvan/tailwind.config.js
tailwind CSS breakpoints (including iPhone 11 Pro Max)
// References used:
// - https://yesviz.com/devices.php
// - https://ricostacruz.com/til/css-media-query-breakpoints
// - https://tailwindcss.com/docs/responsive-design/#customizing-breakpoints
screens: {
xs: { max: '575px' }, // Mobile (iPhone 3 - iPhone XS Max).
sm: { min: '576px', max: '897px' }, // Mobile (matches max: iPhone 11 Pro Max landscape @ 896px).
md: { min: '898px', max: '1199px' }, // Tablet (matches max: iPad Pro @ 1112px).
lg: { min: '1200px' }, // Desktop smallest.
xl: { min: '1159px' }, // Desktop wide.
@denielchiang
denielchiang / setup_tailwind_in_phoenix.md
Created February 12, 2020 10:43 — forked from josephan/setup_tailwind_in_phoenix.md
Add Tailwind CSS to an Elixir/Phoenix Project with PurgeCSS
@denielchiang
denielchiang / randomizer.ex
Created June 18, 2019 09:15 — forked from ahmadshah/randomizer.ex
Random string in elixir
defmodule Randomizer do
@moduledoc """
Random string generator module.
"""
@doc """
Generate random string based on the given legth. It is also possible to generate certain type of randomise string using the options below:
* :all - generate alphanumeric random string
* :alpha - generate nom-numeric random string
sudo yum -y install gcc gcc-c++ glibc-devel make ncurses-devel openssl-devel autoconf java-1.8.0-openjdk-devel git
sudo yum -y install wxBase.x86_64
sudo yum -y install wget
wget http://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
sudo rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
sudo yum -y install esl-erlang
sudo mkdir /opt/elixir
sudo git clone https://github.com/elixir-lang/elixir.git /opt/elixir
cd /opt/elixir
sudo make clean test