Skip to content

Instantly share code, notes, and snippets.

View joe11051105's full-sized avatar

Joe Wang joe11051105

View GitHub Profile

Rails naming conventions

General Ruby conventions

Class names are CamelCase.

Methods and variables are snake_case.

Methods with a ? suffix will return a boolean.

Rails naming conventions

General Ruby conventions

Class names are CamelCase.

Methods and variables are snake_case.

Methods with a ? suffix will return a boolean.

@joe11051105
joe11051105 / 2017-06-01.md
Created June 1, 2017 14:27 — forked from xdite/2017-06-01.md
参与全栈学习这么久,你觉得自己和之前最大的不同是? (直播问卷答案-共94份答案)

参与全栈学习这么久,你觉得自己和之前最大的不同是?

对编程有了系统的概念,之前总是从入门到放弃,这次终于自己能够做出完整的作品,对于自己学习其它技能的自信心也大大增强了,自己的小创意有了实现的能力,对于编程的越来越有热情。

关于全栈,之前一直觉得自己很全能,什么都会一点,但是在参加 jdstore 比赛的时候发现,一个人的时间是非常有限的,和他人配合能够大大的提高效率,大家一起做才能够在有限的时间内完成理想中的工作量,所以自己会做是一方面,懂得和人配合,团队之间的沟通也非常重要。

参与全栈学习这么久,你觉得自己和之前最大的不同是?

  1. 学会了主动学习,对自己更加自信,不再惧怕挑战。
  2. 每日写orid,让自己的逻辑更加清楚。
@joe11051105
joe11051105 / base_controller.rb
Created May 17, 2017 07:37 — forked from dhoelzgen/base_controller.rb
CORS in Rails 4 APIs
class API::V1::BaseController < ApplicationController
skip_before_filter :verify_authenticity_token
before_filter :cors_preflight_check
after_filter :cors_set_access_control_headers
def cors_set_access_control_headers
headers['Access-Control-Allow-Origin'] = '*'
headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'
@joe11051105
joe11051105 / gist:00ced47ea536ea506a9a46d8862c7fc0
Created February 21, 2017 09:33 — forked from pbiggar/gist:3166676
Sample circle.yml file
########################
# Customize the test machine
########################
machine:
# Set the timezeone - any value from /usr/share/zoneinfo/ is valid here
timezone:
America/Los_Angeles
# Version of ruby to use
@joe11051105
joe11051105 / database_cleaner.rb
Created November 10, 2016 06:16 — forked from jsteiner/database_cleaner.rb
Database Cleaner
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
config.before(:each, js: true) do
@joe11051105
joe11051105 / application_controller.rb
Created June 29, 2016 13:23 — forked from scottwb/application_controller.rb
Get a list of all the filters on a given Rails 3 controller.
# Add these methods to your ApplicationController. Then, any controller
# that inherits from it will have these methods and can programmatically
# determine what filters it has set.
class ApplicationController < ActionController::Base
def self.filters(kind = nil)
all_filters = _process_action_callbacks
all_filters = all_filters.select{|f| f.kind == kind} if kind
all_filters.map(&:filter)
end
@joe11051105
joe11051105 / README.md
Created May 26, 2016 14:22 — forked from philipz/README.md
Docker Network Alias

Reference

docker network create lb
docker run -d --name nginx1  --net lb --net-alias nginx nginx
docker run -d --name nginx2  --net lb --net-alias nginx nginx
docker run -d --name nginx-lb -p 80:80 -v $(pwd):/data --net lb nginx
docker exec -ti nginx-lb bash

1. In the nginx-lb console

@joe11051105
joe11051105 / introrx.md
Created May 25, 2016 01:41 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@joe11051105
joe11051105 / .babelrc
Created May 24, 2016 14:29 — forked from c9s/.babelrc
webpack + babel + typescript + es6 - total solutions!
{
"presets": ["es2015"],
"plugins": ["transform-runtime"]
}