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 / generate-ssh-keys.sh
Last active June 8, 2019 07:47
correct file permission for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/aws_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/digital_ocean_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/heroku_rsa
@denielchiang
denielchiang / install-PHP_phpMyAdmin.sh
Last active December 12, 2018 12:17
install Wordpress on centOS 7 (digital-ocean)
sudo yum install php php-mysql -y
sudo yum install epel-release -y
sudo yum clean all -y
sudo yum update -y
sudo yum install phpmyadmin -y
service httpd restart
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
@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
@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 / 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 / build_init.sh
Created February 16, 2020 22:29
When server has been created do this first
useradd -m -s /bin/bash deploy
"deploy ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/10-app-deploy
mkdir -p ~deploy/.ssh
chown deploy:deploy ~deploy/.ssh
chmod 700 ~deploy/.ssh
cp ~root/.ssh/authorized_keys ~deploy/.ssh
chown deploy:deploy ~deploy/.ssh/authorized_keys
@denielchiang
denielchiang / Pull images
Last active February 16, 2020 22:35
Pull images
# 把image拉下你的local端
docker pull deniel79/elixir-phx-centos8
# 執行並進入docker裡
docker run -it deniel79/elixir-phx-centos8
# 檢查是否已安裝好
asdf current
@denielchiang
denielchiang / ckeditor.js
Last active March 22, 2020 10:09
Customize CKEdtior
/**
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
// The editor creator to use.
import ClassicEditorBase from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials';
import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
@denielchiang
denielchiang / webpack.config.js
Created March 22, 2020 10:07
Customize CKEditor
/**
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
'use strict';
/* eslint-env node */
const path = require( 'path' );