Skip to content

Updated the contributing docs #215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Oct 4, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 51 additions & 41 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,26 @@
## **Protip for Contributors**

When committing a Pull Request for non-application/test code please add [`[skip ci]`](http://docs.travis-ci.com/user/how-to-skip-a-build/) to your commit message.

# Code Conventions and Style Guide

Please refer to the community Ruby & Rails Style Guides created by [bbatsov](https://github.com/bbatsov), author of [Rubocop](https://github.com/bbatsov/rubocop).

[Ruby Style Guide](https://github.com/bbatsov/ruby-style-guide/blob/master/README.md)
[Rails Style Guide](https://github.com/bbatsov/rails-style-guide/blob/master/README.md)

# Contributing

Here are the steps for getting setup & started with contributing to Coderwall :

1. Go to [https://assemblymade.com/coderwall](https://assemblymade.com/coderwall) and sign up.
2. Link your GitHub account to your Assembly account in your profile settings.
3. [Fork the code](https://github.com/assemblymade/coderwall).
4. Create a new WIP at [https://assemblymade.com/coderwall/wips](https://assemblymade.com/coderwall/wips).
5. Get vagrant running
6. Run the test suite
3. [Fork assemblymade/coderwall](https://github.com/assemblymade/coderwall).
4. Install Virtualbox and Vagrant
5. Prepare your vagrant.yml and .env files
6. Execute `run.sh` (or `run.bat` on Windows)
7. If you have any issues, jump into chat, introduce yourself and ask or leave a message if no one is around.
8. Find an [interesting bounty](https://assemblymade.com/coderwall/wips) on Assembly or suggest a new one.
9. Fork and then issue a PR when you are done referencing the Bounty. (Note: Only PRs from those with valid Assembly account will be merged).
9. Issue a PR with your work when it is ready for review. (Note: Only PRs from those with valid Assembly account will be merged).

You're on your way to having a stake in Coderwall.

## External Dependencies
# How to set up the environment

### Stripe configuration
We have videos and text instructions on how to get up and running to develop on Coderwall.

You'll need to set up a test account with Stripe for local development until this dependency is refactored out of development/test.
## Check out our video tutorials on how to get started with developing on Coderwall

## Github configuration

You will need a Github application configured for local development until this dependency is refactored out of development/test.

- Create a new GitHub application at [https://github.com/settings/applications/new](https://github.com/settings/applications/new).
- Copy the the ENV variables that you'll need from GitHub.

![The .env will need these values](https://www.evernote.com/shard/s13/sh/3f74a2f7-82d1-46a0-af9c-28f983ad22af/6adc72742c10ddd4ff3c1b711b8d0e27/deep/0/OAuth-Application-Settings.png)

## How to run Coderwall locally.

We use Vagrant to isolate all of our dependencies without polluting your normal working environment.

You're free to not use Vagrant but by the time you're done setting up you'll probably already have given up and installed Vagrant.
[![Coderwall New Developer Guides](http://img.youtube.com/vi/OWqTkhbcXUM/0.jpg)](http://www.youtube.com/playlist?list=PLhlPwpqjsgvXK4n8FJBbj7KkvuOw8h3FO)

### How to work on Coderwall using Vagrant on VirtualBox

Expand All @@ -56,6 +32,8 @@ Here's everything you need to get started working on Coderwall with Vagrant TODA

*At the time of writing this document we were using VirtualBox 4.3.12 and Vagrant 1.6.5.*

**WE ARE USING VIRTUALBOX 4.3.12 DUE TO COMPATABILITY ISSUES WITH VBOX GUEST ADDITIONS.**

#### Vagrant! I already know what to do.

__If you're an experienced Vagrant user then you can fetch the base box and register it yourself.__
Expand All @@ -70,11 +48,13 @@ If you're running Windows, [here's a guide written by one of our members on how

1. **Install VirtualBox**

Grab the VirtualBox installer from **[here](https://www.virtualbox.org/wiki/Downloads)**.
Grab the VirtualBox installer from **[here](https://www.virtualbox.org/wiki/Download_Old_Builds_4_3)**.

![Download the Vbox installer and extensions from here](https://www.evernote.com/shard/s13/sh/68b6a635-7a80-444b-a210-c1aa61405efc/955c950ebafc46f0f1069e27e85bb120)

_At the time of writing this documentation the current version is VirtualBox 4.3.12._
The _required_ version is **VirtualBox 4.3.12.**

You don't have to install the VirtualBox 4.3.12 Oracle VM VirtualBox Extension Pack but I recommend installing it for the extra drivers.
I recommend installing VirtualBox 4.3.12 Oracle VM VirtualBox Extension Pack for the extra drivers.

2. **Install Vagrant**

Expand Down Expand Up @@ -115,11 +95,9 @@ If you're running Windows, [here's a guide written by one of our members on how
Now that you've got VirtualBox and Vagrant installed with the source code cloned in `~/assemblymade/coderwall` we can start up the Vagrant instance.

cd ~/assemblymade/coderwall
vagrant up

You will likely be prompted for your `sudo` password to allow VirtualBox to mount the shared folder using NFS.
./run.sh # or run.bat if you're on Windows

Since this is probably the first time you're running this command it's going to take a VERY long time (bandwidth willing) to run. This is because Vagrant needs to fetch the Coderwall base box from the Internet and it's about 1GB. Fortunately that really only has to be done once (unless the base box get's updated but that's another story).
Since this is probably the first time you're running this command it's going to take a VERY long time (bandwidth willing) to run. This is because Vagrant needs to fetch the Coderwall base box from the Internet and it's about 1.4GB. Fortunately that really only has to be done once (unless the base box get's updated but that's another story).

Once Vagrant reports that you're booted up and ready to go then you'll be able to SSH into the local vm similiar to any other remote box.

Expand Down Expand Up @@ -183,9 +161,41 @@ If you're running Windows, [here's a guide written by one of our members on how

If you need to change any environment variable you have to edit ```.env``` file properly and restart Rails server running:

vagrant ssh -c "sudo restart coderwall"
vagrant reload ; ./run.sh


9. **Thanks**

I hope you enjoy working with Vagrant as much as we do and feel free to ask questions if you get stuck or have a problem. You're probably not alone and even if you're the first to encounter a rough patch you won't be the last.

## External Dependencies

### Stripe configuration

You'll need to set up a test account with Stripe for local development until this dependency is refactored out of development/test.

## Github configuration

You will need a Github application configured for local development until this dependency is refactored out of development/test.

- Create a new GitHub application at [https://github.com/settings/applications/new](https://github.com/settings/applications/new).
- Copy the the ENV variables that you'll need from GitHub.

![The .env will need these values](https://www.evernote.com/shard/s13/sh/3f74a2f7-82d1-46a0-af9c-28f983ad22af/6adc72742c10ddd4ff3c1b711b8d0e27/deep/0/OAuth-Application-Settings.png)

## How to run Coderwall locally.

We use Vagrant to isolate all of our dependencies without polluting your normal working environment.

You're free to not use Vagrant but by the time you're done setting up you'll probably already have given up and installed Vagrant.

## **Protip for Contributors**

When committing a Pull Request for non-application/test code please add [`[skip ci]`](http://docs.travis-ci.com/user/how-to-skip-a-build/) to your commit message.

# Code Conventions and Style Guide

Please refer to the community Ruby & Rails Style Guides created by [bbatsov](https://github.com/bbatsov), author of [Rubocop](https://github.com/bbatsov/rubocop).

[Ruby Style Guide](https://github.com/bbatsov/ruby-style-guide/blob/master/README.md)
[Rails Style Guide](https://github.com/bbatsov/rails-style-guide/blob/master/README.md)
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ gem 'rakismet'
gem 'ruby-progressbar'
gem 'sanitize'
gem 'simple_form'
gem 'sitemap_generator'
gem 'tweet-button'
gem 'local_time'

Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,8 @@ GEM
rack (~> 1.4)
rack-protection (~> 1.4)
tilt (~> 1.3, >= 1.3.4)
sitemap_generator (5.0.5)
builder
slim (2.0.3)
temple (~> 0.6.6)
tilt (>= 1.3.3, < 2.1)
Expand Down Expand Up @@ -804,6 +806,7 @@ DEPENDENCIES
simple_form
simplecov
sinatra
sitemap_generator
slim-rails
spring
spring-commands-rspec
Expand Down
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,9 @@

A community for developers to unlock & share new skills.


## **Protip for Contributors**

When committing a Pull Request for non-application/test code please add [`[skip ci]`](http://docs.travis-ci.com/user/how-to-skip-a-build/) to your commit message.

## Contributing & Getting Started

Please see our [/master/CONTRIBUTING.md](https://github.com/assemblymade/coderwall/blob/master/CONTRIBUTING.md) for instructions on how to set up your development environment for Coderwall.
**IMPORTANT**: Please see our [/master/CONTRIBUTING.md](https://github.com/assemblymade/coderwall/blob/master/CONTRIBUTING.md) for instructions on how to set up your development environment for Coderwall.

## Built With

Expand Down
4 changes: 4 additions & 0 deletions app/clock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,9 @@
ClearExpiredSessionsJob.perform_async
end

every(1.day, 'sitemap:refresh', at: '06:00') do
SitemapRefreshWorker.perform_async
end

# This is tied with broken code. Probably should delete
# every(1.day, 'facts:system', at: '00:00') {}
3 changes: 2 additions & 1 deletion app/controllers/protips_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,8 @@ def search_options

{
page: (signed_in? && search_options_params[:page].try(:to_i)) || 1,
per_page: [(signed_in? && search_options_params[:per_page].try(:to_i)) || 18, Protip::PAGESIZE].min
per_page: [(signed_in? && search_options_params[:per_page].try(:to_i)) || 18, Protip::PAGESIZE].min,
load: { include: [:user, :likes, :protip_links, :comments] }
}
end

Expand Down
6 changes: 3 additions & 3 deletions app/models/protip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -551,15 +551,15 @@ def best_stat
{
views: self.total_views/COUNTABLE_VIEWS_CHUNK,
upvotes: self.upvotes,
comments: self.comments.count,
comments: self.comments.size,
hawt: self.hawt? ? 100 : 0
}.sort_by do |k, v|
-v
end.first
end

def upvotes
@upvotes ||= likes.count
likes.size
end

def upvotes=(count)
Expand Down Expand Up @@ -782,7 +782,7 @@ def images
if self.new_record?
self.links.select { |link| ProtipLink.is_image? link }
else
protip_links.where('kind in (?)', ProtipLink::IMAGE_KINDS).map(&:url)
protip_links.loaded? ? protip_links.select { |p| ProtipLink::IMAGE_KINDS.include?(p.kind.to_sym) }.map(&:url) : protip_links.where('kind in (?)', ProtipLink::IMAGE_KINDS).map(&:url)
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/protips/_grid.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
- if protip == 'show-ad'
= render(partial: 'opportunities/mini', locals: { opportunity: opportunity })
-elsif protip.present?
- if protip = protip.load rescue nil # HACK: User deleted, protip no longer exists. Won't be found.
- if protip.is_a?(Protip) || protip = protip.load rescue nil # HACK: User deleted, protip no longer exists. Won't be found.
%li{ class: (protip.kind == 'link' ? 'ext-link' : '') }
= render(partial: 'protips/mini', locals: { protip: protip, mode: mode })

Expand Down
40 changes: 40 additions & 0 deletions app/workers/sitemap_refresh_worker.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
class SitemapRefreshWorker
include Sidekiq::Worker
sidekiq_options queue: :high

def perform
SitemapGenerator::Sitemap.default_host = "https://coderwall.com"
SitemapGenerator::Sitemap.public_path = 'tmp/'
SitemapGenerator::Sitemap.sitemaps_host = "http://#{ENV['FOG_DIRECTORY']}.s3.amazonaws.com/"
SitemapGenerator::Sitemap.sitemaps_path = 'sitemaps/'
SitemapGenerator::Sitemap.adapter = SitemapGenerator::WaveAdapter.new

SitemapGenerator::Sitemap.create do
add '/welcome', :priority => 0.7, :changefreq => 'montlhy'
add '/contact_us', :priority => 0.5, :changefreq => 'montlhy'
add '/blog', :priority => 0.7, :changefreq => 'weekly'
add '/api', :priority => 0.5, :changefreq => 'monthly'
add '/faq', :priority => 0.5, :changefreq => 'monthly'
add '/privacy_policy', :priority => 0.2, :changefreq => 'monthly'
add '/tos', :priority => 0.2, :changefreq => 'monthly'
add '/jobs', :priority => 0.7, :changefreq => 'daily'
add '/employers', :priority => 0.7, :changefreq => 'monthly'
Protip.find_each do |protip|
add protip_path(protip), :lastmod => protip.updated_at
end
Team.all.each do |team|
add teamname_path(slug: team.slug), :lastmod => team.updated_at
team.jobs.each do |job|
add job_path(:slug => team.slug, :job_id => job.public_id), :lastmod => job.updated_at
end
end
User.find_each do |user|
add badge_path(user.username), :lastmod => user.updated_at
end
BlogPost.all_public.each do |blog_post|
add blog_post_path(blog_post.id), :lastmod => blog_post.posted
end
end
SitemapGenerator::Sitemap.ping_search_engines
end
end
67 changes: 49 additions & 18 deletions public/humans.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,37 +26,51 @@ Email: Zane.Wolfgang.Pickett [at] Gmail.com
GitHub: @sirwolfgang
Location: United States

Contributor: Britt Mileshosky
GitHub: @Mileshosky

Contributor: Dane Lyons
GitHub: @DaneLyons
Location: SF

Contributor: Rex Morgan
GitHub: @RexMorgan
Location: Austin, Texas

Contributor: Britt Mileshosky
GitHub: @Mileshosky
Contributor: Nícolas Iensen
Email: nicolas [at] iensen.me
GitHub: @nicolasiensen
Location: Rio de Janeiro

Contributor: Wesley Lancel
GitHub: @wesleylancel
Location: Belgium / The Netherlands

Contributor: Nícolas Iensen
Email: nicolas [at] iensen.me
GitHub: @nicolasiensen
Location: Rio de Janeiro
Contributor: Silas Sao
Email: silassao [at] gmail.com
GitHub: @sao
Location: California

Contributor: Carl Woodward
Email: carl [at] 88cartell.com
GitHub: @carlwoodward
Location: Sydney

Contributor: Justin Raines
Email: justraines [at] gmail.com
GitHub: @dvito
Location: Washington, DC

Contributor: Aaron Raimist
Email: aaron [at] aaronraimist.com
GitHub: @aaronraimist
Location: St. Louis

Contributor: Anthony Kosednar
Email: anthony.kosednar [at] gmail.com
GitHub: @akosednar
Location: USA

Contributor: Aaron Raimist
Email: aaron [at] aaronraimist.com
GitHub: @aaronraimist
Location: St. Louis

Contributor: Drew Blas
GitHub: @drewblas

Expand All @@ -68,13 +82,31 @@ Location: San Francisco, CA
Contributor: Jon Khaykin
GitHub: @jkhaykin

Contributor: Greg Molnar
GitHub: @gregmolnar
Contributor: Gosha Arinich
Email: me [at] goshakkk.name
GitHub: @goshakkk
Location: Minsk, Belarus

Contributor: Charles Pletcher
GitHub: @Pletcher
Location: San Francisco Bay Area

Contributor: Daniel Fone
Email: daniel [at] fone.net.nz
GitHub: @danielfone

Contributor:
GitHub: @alxers

Contributor: Greg Molnar
GitHub: @gregmolnar
Location: Basingstoke, UK

Contributor: John Haugeland
Email: stonecypher [at] gmail.com
GitHub: @StoneCypher
Location: San Francisco, CA

Contributor: Matej Kramny
Email: github [at] matej.me
GitHub: @matejkramny
Expand All @@ -85,14 +117,13 @@ Email: send.sachin [at] yahoo.com
GitHub: @sachinm
Location: Atlanta, GA

Contributor: Silas Sao
Email: silassao [at] gmail.com
GitHub: @sao
Location: California
Contributor: Sun Liang
GitHub: @unstop
Location: China


/* SITE */
Last update: 2014/07/26
Last update: 2014/09/30
Standards: HTML5, CSS3
Components: Ruby on Rails, jQuery, Sass, Backbone.js, Ember.js, PostgreSQL, ElasticSearch, MongoDB, Redis, etc.
Software: Vim, Tmux, Vagrant, Git, etc.
Expand Down
Loading