Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

John Hu hutusi

🎯
Focusing
View GitHub Profile
@hutusi
hutusi / model.rb
Created Oct 7, 2019
Organizing-Ruby-on-Rails-Models
View model.rb
class User < ActiveRecord::Base
# == Constants ============================================================
# == Attributes ===========================================================
# == Extensions ===========================================================
# == Relationships ========================================================
@hutusi
hutusi / git paging.md
Last active Jul 5, 2020
Git checkout next / prev commit
View git paging.md

Treat git log as a book, exec git next or git prev to checkout the next or the previous commit.

@hutusi
hutusi / .rubocop.yml
Created Oct 9, 2017 — forked from jhass/.rubocop.yml
My preferred Rubocop config
View .rubocop.yml
AllCops:
RunRailsCops: true
# Commonly used screens these days easily fit more than 80 characters.
Metrics/LineLength:
Max: 120
# Too short methods lead to extraction of single-use methods, which can make
# the code easier to read (by naming things), but can also clutter the class
Metrics/MethodLength:
View git-mergetool-winmerge-setup.sh
#!/bin/sh
#
# This script will make WinMerge your default tool for diff and merge.
# It must run inside git bash (on Windows)
#
# If your WinMerge is in other place then this one, please edit
WINMERGE_SCRIPT="winmerge-merge.sh"
View gist:8661255
REST
https://restful-api-design.readthedocs.org/en/latest/methods.html
@hutusi
hutusi / smtp_settings.rb
Last active Dec 25, 2015
GitLab 6.1 email (smtp) configuration.
View smtp_settings.rb
# To enable smtp email delivery for your GitLab instance do next:
# 1. Change config/environments/production.rb to use smtp
# config.action_mailer.delivery_method = :smtp
# 2. Rename this file (config/initializers/smtp_settings.rb) to smtp_settings.rb
# 3. Edit settings inside this file
# 4. Restart GitLab instance
#
if Gitlab::Application.config.action_mailer.delivery_method == :smtp
ActionMailer::Base.smtp_settings = {
address: "smtp.gmail.com",
You can’t perform that action at this time.