Skip to content

Instantly share code, notes, and snippets.

class CommentsController < ApplicationController
def users_comments
posts = Post.all
comments = posts.map(&:comments).flatten
@user_comments = comments.select do |comment|
comment.author.username == params[:username]
end
end
end
variables:
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker:2375/
DOCKER_BUILDKIT: 1
build:
stage: build
services:
- name: docker:dind
command: ["dockerd", "--host=tcp://0.0.0.0:2375"]
#!/usr/bin/env bash
apt-get -y update
apt-get -y install git-core ruby1.9.1
gem install chef ruby-shadow --no-ri --no-rdoc
@carlallen
carlallen / gist:1356719
Created November 11, 2011 00:15
Feature
Add a new feature that allows for a Matching Question.
Matching Questions should allow multiple pairs of options and answers.
EXAMPLE:
Matching
40-44) Match the weather to the word that best describes it.
@carlallen
carlallen / questions
Created June 14, 2011 22:33
Rails Questions
>> User.first.email
>> User.all.collect{|u| u.status}.uniq.size