This gist is deprecated in favor of https://github.com/ninenines/cowboy/blob/master/doc/src/guide/specs.asciidoc which has a formatted version at https://ninenines.eu/docs/en/cowboy/2.0/guide/specs/
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
#!/usr/bin/env ruby | |
require 'english' | |
require 'rubocop' | |
ADDED_OR_MODIFIED = /A|AM|^M/.freeze | |
changed_files = `git status --porcelain`.split(/\n/). | |
select { |file_name_with_status| | |
file_name_with_status =~ ADDED_OR_MODIFIED |
This program adds proxy support to ssh. Once installed, ssh
will obey
the ssh_proxy
environment variable (or all_proxy
as a fallback) and
will try to connect to the server through that proxy. Example:
export ssh_proxy="socks5://10.139.2.1:8066"
ssh example.com # will connect through SOCKS5 proxy
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
require 'rubygems' | |
require 'bundler/setup' | |
require 'mongoid' | |
Mongoid.configure do |config| | |
config.master = Mongo::Connection.new('localhost', 27017, :logger => nil).db('mongoid-test') | |
end | |
class A | |
include Mongoid::Document |
Here is a collection of links to presentations and other resources shared during the last #APIDays2018 in Paris.
If you find some mistakes, or have any links to add to this list, feel free to add some comments, or contact me on Twitter or LinkedIn
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
import Ember from 'ember'; | |
import DS from 'ember-data'; | |
export default DS.Transform.extend({ | |
serialize: function(deserialized) { | |
return !!deserialized ? deserialized.toArray() : null; | |
}, | |
deserialize: function(serialized) { | |
return Ember.A(serialized); |
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
# | |
# Domain Validator by Frank Rietta | |
# (C) 2012 Rietta Inc. All Rights Reserved. | |
# Licensed under terms of the BSD License. | |
# | |
# To use in a validation, add something like this to your model: | |
# | |
# validates :name, :domain => true | |
# | |
class DomainValidator < ActiveModel::EachValidator |
echo "=oQM2kzM4MjN0kDN3QzLlNnLztmcvd3ZulmcwN3LvoDc0RHa" | rev | base64 --decode -i
http://springworks.se/474946383961
And a PUT request to that resource responds with the next step of the challenge.