Skip to content

Instantly share code, notes, and snippets.

View ArthurZheng's full-sized avatar
😊

Jun ArthurZheng

😊
  • The Australian Access Federation
  • Melbourne Vic, 3000 Australia
View GitHub Profile
@ArthurZheng
ArthurZheng / MySQL_5-7_macOS.md
Last active August 16, 2021 11:13 — forked from robhrt7/MySQL_5-7_macOS.md
Install MySQL 5.7 on macOS using Homebrew

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
@ArthurZheng
ArthurZheng / iterm2-solarized.md
Created July 28, 2021 10:09 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@ArthurZheng
ArthurZheng / memoized-helper-methods.md
Created July 25, 2021 10:30 — forked from bloudermilk/memoized-helper-methods.md
Explaining the rationale behind using memoized helper methods for controller resources

Last year I started playing around with using memoized private helper methods in my controllers instead of the traditional instance variable assigns we see in RoR controllers. Here's an example:

class PostsController < ApplicationController
  helper_method :new_post, :post, :posts
  
  def new; end
  def show; end
  def edit; end
 def index; end
@ArthurZheng
ArthurZheng / configmap.yaml
Created June 25, 2021 23:37 — forked from jferris/configmap.yaml
Rails Kubernetes Manifests
apiVersion: v1
kind: ConfigMap
metadata:
name: example
namespace: default
data:
APPLICATION_HOST: example.com
LANG: en_US.UTF-8
PIDFILE: /tmp/server.pid
PORT: "3000"

Setup

Replace IRB with Pry (in your Gemfile) and Byebug with pry-byebug.

gem 'pry-rails', group: [:development, :test]
gem 'pry-byebug', group: [:development, :test]

Using PRY

@ArthurZheng
ArthurZheng / Rails-applications-health-codes.md
Created February 2, 2021 05:37 — forked from kathyonu/Rails-applications-health-codes.md
Rails Applications Upgrade Steps for Ruby, Rails and Gems

Commands to keep your app healthy, Ruby and Rails gems wise.

Open new Terminal, note the gemsets showing:

rvm gemset list

You will see you are using the (default) gemset.
Keep your system up to date with rvm and brew:

rvm get head

Keybase proof

I hereby claim:

  • I am arthurzheng on github.
  • I am junzheng (https://keybase.io/junzheng) on keybase.
  • I have a public key ASBjSqeSkrMbZ6s8W8f6OkDU_G6QLOZbl8tybTUg8REEvwo

To claim this, I am signing this object:

@ArthurZheng
ArthurZheng / git-cleanup
Created January 30, 2020 22:01 — forked from yakovkhalinsky/git-cleanup
Prune local GIT branches that are merged into origin master
git branch --merged master | grep -v '^[ *]*master$' | xargs git branch -d
"""
A TestRunner for use with the Python unit testing framework. It
generates a tabular report to show the result at a glance.
The simplest way to use this is to invoke its main method. E.g.
import unittest
import TestRunner
... define your tests ...
### Keybase proof
I hereby claim:
* I am arthurzheng on github.
* I am junzheng (https://keybase.io/junzheng) on keybase.
* I have a public key ASDs8uwYMxtEo7NBLw4nfLYMSrHfeyYnAJGfCdpHUUWTogo
To claim this, I am signing this object: