<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>
-
URL
<The URL Structure (path only, no root url)>
-
Method:
| class HealthCheck | |
| class Middleware | |
| def initialize(application) | |
| @application = application | |
| end | |
| def call(environment) | |
| if environment['PATH_INFO'] == '/health-check' | |
| if HealthCheck.healthy? |
| ip_address_whitelist: | |
| - 127.0.0.1 | |
| - 1.2.3.4 | |
| - 5.6.7.8 | |
| whitelisted_pages: | |
| - /assets/.* | |
| - / | |
| - /login |
| # First blacklist checks for /etc/password, and counts hits in cache | |
| blacklist 'etc/password' do | |
| if req.query_string =~ %r{/etc/passwd} | |
| Fail2Ban.fail('etc_password', req.ip, limit: 3, period: 24.hours, ban_for: 24.hours) | |
| end | |
| end | |
| # 2nd blacklist checks for banned IPs in cache | |
| blacklist 'banned_ips' do | |
| Fail2Ban.banned?(req.ip) |
| # Timezone extension to Sidetiq | |
| Sidetiq::Schedulable::ClassMethods.class_eval do | |
| # Sets the time zone for the recurrence rules. | |
| # | |
| # Example: | |
| # | |
| # class MyWorker | |
| # include Sidekiq::Worker | |
| # include Sidetiq::Schedulable | |
| # |
| # config/initializers/doorkeeper.rb | |
| Doorkeeper.configure do | |
| client_credentials :from_obfuscated_params | |
| end | |
| module Doorkeeper | |
| module OAuth | |
| class Client | |
| module Methods | |
| def from_obfuscated_params(request) |
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'aws-sdk' | |
| class S3FolderUpload | |
| attr_reader :folder_path, :total_files, :s3_bucket | |
| attr_accessor :files |
| ### pfx to pem, complete edition: | |
| $ openssl pkcs12 -in filename.pfx -nocerts -out key.pem | |
| $ openssl pkcs12 -in filename.pfx -clcerts -nokeys -out cert.pem | |
| $ openssl pkcs12 -in filename.pfx -cacerts -out ca_cert.pem |
| // turbolinks addthis | |
| var initAdthis; | |
| initAdthis = function(){ | |
| // Remove all global properties set by addthis, otherwise it won't reinitialize | |
| for (var i in window) { | |
| if (/^addthis/.test(i) || /^_at/.test(i)) { | |
| delete window[i]; | |
| } | |
| } |
| 100 = :continue | |
| 101 = :switching_protocols | |
| 102 = :processing | |
| 200 = :ok | |
| 201 = :created | |
| 202 = :accepted | |
| 203 = :non_authoritative_information | |
| 204 = :no_content | |
| 205 = :reset_content | |
| 206 = :partial_content |