Skip to content

Instantly share code, notes, and snippets.

Avatar

D. Deryl Downey ddd

View GitHub Profile
@ddd
ddd / .gitconfig
Last active Mar 11, 2021
.gitconfig
View .gitconfig
[filter "lfs"]
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
[user]
name = D. Deryl Downey
email = ddd@users.noreply.github.com
[core]
autocrlf = true
View test-gist
<h1>Pages#index</h1>
<div class="container-fluid">
<p>Find me in app/views/pages/index.html.erb</p>
</div>
View .vimrc
set nocompatible " Be iMproved
filetype off
" Vundle
set rtp+=~/.vim/bundle/vundle
call vundle#begin()
Plugin 'gmarik/vundle'
" Brief help
@ddd
ddd / npm_output.sh
Created Dec 23, 2014
npm install javascripting learnyounode git-it stream-adventure -g
View npm_output.sh
∵ npm install learnyounode git-it stream-adventure -g
> ws@0.4.32 install /home/ubuntu/nodejs/lib/node_modules/stream-adventure/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory `/home/ubuntu/nodejs/lib/node_modules/stream-adventure/node_modules/ws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/obj.target/bufferutil.node
SOLINK_MODULE(target) Release/obj.target/bufferutil.node: Finished
COPY Release/bufferutil.node
@ddd
ddd / console.sh
Created Dec 22, 2014
NodeSchool.io Node.JS for-loop problem
View console.sh
-------------------
# FOR LOOPS
For loops look like this:
for (var i = 0; i < 10; i++) {
// log the numbers 0 through 9
console.log(i)
}
View file_loading.rb
Dir["#{File.join(File.dirname(__FILE__), '../../app/models/*.rb')}"].each do |model|
load "#{model}"
end
@ddd
ddd / _rescue_groups.rb
Created Mar 5, 2014
dashboards/show.html.erb and _rescue_groups partial. This works if I don't use a partial, just fine.
View _rescue_groups.rb
<h1><%= current_user.name.titleize %>'s Dashboard</h1>
<div class="well well-sm">
<%= link_to "Add a New Shelter", new_rescue_group_shelter_path(current_user) %> -
<%= link_to "Add a New Transporter", new_rescue_group_transporter_path(current_user) %>
</div>
<div class="panel panel-info", data-no-turbolink>
<div class="panel-heading">Account Information</div>
<strong>Owner:</strong> <%= current_user.user.full_name %><br />
<strong>Username:</strong> <%= current_user.user.username %><br />
View relevant_rspec_output.rb
Failures:
1) User when persisted will be valid
Failure/Error: expect(subject.valid?).to be_true
expected: true value
got: false
# ./spec/models/user_spec.rb:18:in `block (3 levels) in <top (required)>'
Finished in 10.23 seconds
73 examples, 1 failure, 5 pending
@ddd
ddd / rescue_groups_controller.rb
Last active Aug 29, 2015
Failing RSpec test. See the comments in the test spec. Failure msg is attached for wip:true (create) only. [Controller works. back-filling tests]
View rescue_groups_controller.rb
class RescueGroupsController < ApplicationController
def index
@rescue_groups = RescueGroup.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @rescue_groups }
end
end
View rescue_groups_controller_spec.rb
require 'spec_helper'
describe RescueGroupsController do
before(:each) do
@current_user = FactoryGirl.build_stubbed(:user)
controller.stub(:current_user).and_return(@current_user)
end
subject(:rescue_group) { @current_user.rescue_groups.build }