Here's an example of the kind of GraphQL query that Code.gov might submit to the GitHub GraphQL endpoint. It also explains why the switch to using GraphQL (in GitHub API version 4) makes things a ton easier than all the REST calls we were doing before (in GitHub API version 3).
require 'openssl' | |
ssid = 'Delorean' | |
passphrase = 'hoverboardsdonotworkonwater' | |
puts OpenSSL::PKCS5.pbkdf2_hmac_sha1(passphrase, ssid, 4096, 32).unpack("H*").first |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.
These are the steps I went through to set up an SSL cert.
Ember.KonamiCode = Ember.Mixin.create({ | |
konami: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13], | |
currentIndex: 0, | |
keyPress: function(event) { | |
this._super(event); | |
var index = this.get('currentIndex'); | |
if (event.keyCode === this.konami[index]) { | |
if (index === 10) { | |
this.success(); | |
} else { |
function d { | |
did=$(docker run -d precise runsvdir /etc/service) | |
ip=$(docker inspect $did | grep IpAddress | cut -d'"' -f4) | |
nc -z $ip 22 && ssh -oStrictHostKeyChecking=no root@$ip | |
docker kill $did | |
} | |
Changes:
-
this version includes backport of Greg Price's patch for speedup startup http://bugs.ruby-lang.org/issues/7158 .
ruby-core prefers his way to do thing, so that I abandon cached-lp and sorted-lf patches of mine.
-
this version integrates 'array as queue' patch, which improves performance when push/shift pattern is heavily used on Array.
This patch is accepted into trunk for Ruby 2.0 and last possible bug is found by Yui Naruse. It is used in production* for a couple of months without issues even with this bug.
Capybara.add_selector :record do | |
xpath { |record| XPath.css("#" + ActionController::RecordIdentifier.dom_id(record)) } | |
match { |record| record.is_a?(ActiveRecord::Base) } | |
end |
source :rubygems | |
gem 'shotgun', :group=>:development | |
gem 'rack-cache' | |
gem 'sinatra', :require => 'sinatra/base' | |
gem 'sinatra-support' | |
gem 'haml' |
RSpec::Matchers.define :have_json_key do |expected_key| | |
match do |response| | |
@body = MultiJson.load(response.body) | |
result = @body.key?(expected_key.to_s) | |
result &&= @body[expected_key.to_s] == @expected_val if @val_provided | |
result | |
end | |
chain :with_value do |val| |