This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Troop</title> | |
<%= stylesheet_link_tag 'application' %> | |
<%= javascript_include_tag 'application' %> | |
<%= csrf_meta_tags %> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User | |
has_many :friendships | |
has_many :friends, through: :friendships | |
end | |
class Friendship | |
belongs_to :friend, class: User | |
belongs_to :friendee, class: User | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ dig cachefly.alfredapp.com @8.8.8.8 | |
; <<>> DiG 9.8.3-P1 <<>> cachefly.alfredapp.com @8.8.8.8 | |
;; global options: +cmd | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 49360 | |
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0 | |
;; QUESTION SECTION: | |
;cachefly.alfredapp.com. IN A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws ec2 describe-account-attributes --region eu-west-1 | jq '.["AccountAttributes"] | reduce .[] as $item ( {}; (. + {"\($item.AttributeName)": $item.AttributeValues[].AttributeValue}))' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func viewDidLoad() { | |
self.view.backgroundColor = UIColor.whiteColor() | |
self.view.setTranslatesAutoresizingMaskIntoConstraints(false) | |
for clockViewController in self.clockViewControllers { | |
self.view.addSubview(clockViewController.view) | |
} | |
for var i = 0; i < self.clockViewControllers.count; ++i { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RUBY_CONFIGURE_OPTS=--with-readline-dir="/usr/local/Cellar/readline/6.2.4" rbenv install 2.0.0-p451 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
protect_from_forgery with: :exception | |
concerning :Authentication do | |
included do | |
before_action :authenticate_user! | |
end | |
private | |
def authenticate_user! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is an attempt to the following errors: | |
# | |
# PG::UnableToSend: SSL error: cert already in hash table=0A | |
# | |
# This wraps the OpenID::SimpleSign.store method, from the | |
# ruby-openid-apps-discovery gem, in a thread. I believe the root cause of this | |
# error is that in some environment the store gets duplicate certificates added | |
# to it. This causes OpenSSL errors, which then are raised in the pg gem, | |
# because it believes something serious has gone wrong. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## ca-bundle.crt -- Bundle of CA Certificates | |
## Last Modified: Wed Jun 22 11:33:22 EDT 2005 | |
## | |
## This is a bundle of X.509 certificates of public | |
## Certificate Authorities (CA). | |
## | |
-----BEGIN CERTIFICATE----- | |
MIIDtTCCAp2gAwIBAgIRANAeQJAAAEZSAAAAAQAAAAQwDQYJKoZIhvcNAQEFBQAw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Item | |
def self.find_each(params = {}) | |
return enum_for(:find_each) unless block_given? | |
page = nil | |
while page.nil? || page.current_page < page.total_pages | |
if page.nil? | |
page = all params | |
else | |
page = all params.merge(page: page.current_page + 1) |