Skip to content

Instantly share code, notes, and snippets.

View ilunglee's full-sized avatar
🏠
Working from home

I-Lung Lee ilunglee

🏠
Working from home
View GitHub Profile
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do
@ilunglee
ilunglee / rspec_model_testing_template.rb
Created July 26, 2018 23:35 — forked from PWSdelta/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
{
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "upper",
"block-indent": " ",
"color-shorthand": false,
"element-case": "lower",
"eof-newline": true,
"leading-zero": true,
"quotes": "single",
@ilunglee
ilunglee / .bash_profile
Last active July 16, 2020 22:51 — forked from masnun/.bash_profile
My Bash Profile
# Load Postgres current version
export PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH";
# Rbenv auto load when terminal loads
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
# Load .bashrc if it exist
if [ -f ~/.bashrc ]; then source ~/.bashrc; fi
# Load PHP current version
require "awesome_print"
AwesomePrint.irb!
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
# *) local and remote tag names
# Alias for applications
alias atom="open -a Atom"
alias finder="open -a Finder"
alias chrome="open -a 'Google Chrome'"
alias safari="open -a Safari"
# alias code="open -a 'Visual Studio Code'"
# Git Alias
alias gbD="git branch | grep -v "master" | xargs git branch -D"
alias gbT="git for-each-ref --sort=-committerdate refs/heads/ --format='%(authordate:short) %(color:red)%(objectname:short) %(color:yellow)%(refname:short)%(color:reset) (%(color:green)%(committerdate:relative)%(color:reset))'"
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the branch/status of the current git repository
# * the branch of the current subversion repository
# * the return value of the previous command
#
# USAGE:
# BitBucket Access
export BITBUCKET_USERNAME='';
export BITBUCKET_PASSWORD='';
export GIT_OAUTH_TOKEN='';
# Load Postgres current version
export PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH";
# Rbenv auto load when terminal loads
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi