Skip to content

Instantly share code, notes, and snippets.

View eaglerockdude's full-sized avatar

ken mcfadden eaglerockdude

View GitHub Profile
@eaglerockdude
eaglerockdude / format$PATH command
Created May 9, 2018 00:06
echo $PATH | tr ":" "\n" | nl
makes it easier to read
@eaglerockdude
eaglerockdude / rails-postgres-backbone-bootstrap-bootswatch
Created August 29, 2017 16:52 — forked from sionc/rails-postgres-backbone-bootstrap-bootswatch
Instructions on creating a new app using Ruby on Rails, Postgresql, Backbone.js, Twitter Boostrap, Bootstwatch
- Check rails version
$ rails -v
- To update rails
$ gem update rails
- Creating a new rails app using postgresql
$ mkdir rails_projects
$ cd rails_projects
$ rails new myapp --database=postgresql
@eaglerockdude
eaglerockdude / gist:8722fb018c472e55435031f852c194e1
Last active August 16, 2017 15:54
Set up fresh rails environment on UBUNTU
ken@ken-XPS-M1330:~$ cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=17.04
DISTRIB_CODENAME=zesty
DISTRIB_DESCRIPTION="Ubuntu 17.04"
NAME="Ubuntu"
VERSION="17.04 (Zesty Zapus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 17.04"
@eaglerockdude
eaglerockdude / railsport
Created February 25, 2017 14:56
Port 3000 use
lsof -wni tcp:3000
then kill it.
echo "" > log/development.log

Rails naming conventions

General Ruby conventions

Class names are CamelCase.

Methods and variables are snake_case.

Methods with a ? suffix will return a boolean.

@eaglerockdude
eaglerockdude / rspec_model_testing_template.rb
Created April 25, 2016 13:10 — forked from SabretWoW/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:
@eaglerockdude
eaglerockdude / tdo.rb
Last active August 27, 2015 16:45 — forked from sirupsen/tdo.rb
Gist for "What I Wish a Ruby Programmer Had Told Me One Year Ago".
class TodoList < Array
def self.load(file)
# read the file, create a list, create items, add them to the list, return the list
list = TodoList.new
File.read(file).each_line do |line|
list << line.chomp
end
list
end
@eaglerockdude
eaglerockdude / removedir
Created August 15, 2015 19:21
How to remove a nonempty directory with force : linux
rm -rf <directory name>
@eaglerockdude
eaglerockdude / bootstrap_CDN
Created July 2, 2015 14:41
Boostrap based responsive NavBar with CDN links
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Navigation Bar</title>
<!-- Bootstrap -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">