Skip to content

Instantly share code, notes, and snippets.

Clipping to Notion

Yejun Su goofansu

Clipping to Notion
View GitHub Profile
goofansu / example.rb
Last active Mar 5, 2021
Print Rails configuration initialization order
View example.rb
config.before_configuration do
puts 'before_configuration'
config.before_initialize do
puts 'before_initialize'
config.to_prepare do
puts 'to_prepare'
goofansu / gist:3518953b3e215d98768ad371865ab3da
Created Jan 24, 2021
Load Environment Variables with dotenv in NodeJS
View gist:3518953b3e215d98768ad371865ab3da
path: .env.${process.env.NODE_ENV},
goofansu / gist:0e9893419255463ee358914921e2ad3d
Last active Jan 24, 2021
install dpkg with dependencies
View gist:0e9893419255463ee358914921e2ad3d
sudo dpkg -i
sudo apt install -f
View gist:1b39e1115df2d940fab5aaf0de872be4
#!/usr/bin/env bash
curl --user ${CIRCLE_TOKEN}: \
--request POST \
--form revision=HEAD\
--form config=@config.yml \
--form notify=false \
View gist:2a1001d746d70ae23a3655eaaeb27e37
region: ap
subdomain: faria
host_header: rewrite
addr: faria.oa.test:80
proto: http
goofansu / gist:ee829c1fcd0d166479ce5abbc7aba08f
Created Jan 24, 2021
Install apt-get in docker container
View gist:ee829c1fcd0d166479ce5abbc7aba08f
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:beineri/opt-qt542-trusty -y
goofansu / gist:97c03efd422ec35af8d2d086ff703aa3
Created Jan 24, 2021
Fix ld: library not found for -lssl
View gist:97c03efd422ec35af8d2d086ff703aa3
# This error may happen when install gems with native extensions after the macOS upgrade.
brew install openssl
set -gx LIBRARY_PATH $LIBRARY_PATH /usr/local/opt/openssl/lib/
goofansu / breadboard.ex
Last active Dec 14, 2020
blink leds on RPI4
View breadboard.ex
defmodule Breadboard do
alias Circuits.GPIO
defstruct [:gpio_refs, :blink_pid]
def new do
gpio_refs = [16, 17, 26] |>
%__MODULE__{gpio_refs: gpio_refs}
View docker.yml
FROM circleci/ruby:2.3.7-node-browsers
RUN FILE=`mktemp` &&\
URL='' &&\
wget $URL -qO $FILE &&\
sudo dpkg -i $FILE &&\
rm -f $FILE