Skip to content

Instantly share code, notes, and snippets.

View eaglerockdude's full-sized avatar

ken mcfadden eaglerockdude

View GitHub Profile
@eaglerockdude
eaglerockdude / application.html.haml
Created April 22, 2015 01:59
Rails Application Layout in HAML with navbar
!!! 5
%html
%head
%title Recipe App
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
= javascript_include_tag 'application', 'data-turbolinks-track' => true
= csrf_meta_tags
%body
%nav.navbar.navbar-default
@eaglerockdude
eaglerockdude / set_git_remote
Last active August 29, 2015 14:23
change git remote for something you cloned to your repo
git remote set-url origin https://github.com/YOUR_GITHUB_USERNAME/clonedname.git
@eaglerockdude
eaglerockdude / locatedbupdate
Created June 25, 2015 04:01
update the locate db for a mac
sudo /usr/libexec/locate.updatedb
@eaglerockdude
eaglerockdude / app.html.haml_template
Created June 30, 2015 18:25
rails application.html.haml template
!!! 5
%html
%head
%title Recipe App
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
= javascript_include_tag 'application', 'data-turbolinks-track' => true
= csrf_meta_tags
%body
%nav.navbar.navbar-default
@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">
@eaglerockdude
eaglerockdude / removedir
Created August 15, 2015 19:21
How to remove a nonempty directory with force : linux
rm -rf <directory name>
@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 / 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:

Rails naming conventions

General Ruby conventions

Class names are CamelCase.

Methods and variables are snake_case.

Methods with a ? suffix will return a boolean.

echo "" > log/development.log