instead of
desc 'some endpoint', {
headers: { Authorization: {
description: 'Bearer JWT',
required: true
}
}}
get do
instead of
desc 'some endpoint', {
headers: { Authorization: {
description: 'Bearer JWT',
required: true
}
}}
get do
# ruby | |
sudo apt install ruby ruby-dev | |
# env and path | |
export GEM_HOME=$HOME/.gem/ | |
PATH="/home/ubuntu/.gem/bin:$PATH" |
``` | |
yarn add select2 | |
``` | |
# /javascript/stylesheets/active_admin.scss | |
``` | |
@import 'select2/dist/css/select2'; | |
``` | |
# /javascript/active_admin.js |
class PatchSimulatingMiddleware | |
def initialize app | |
@app = app | |
end | |
def call env | |
request = Rack::Request.new(env) | |
if request.post? && ( request.params['_name'] == 'patch' ) | |
request.set_header 'REQUEST_METHOD', 'PATCH' |
class PatchSimulatingMiddleware | |
def initialize app | |
@app = app | |
end | |
def call env | |
request = Rack::Request.new(env) | |
if request.post? && ( request.params['_name'] == 'patch' ) | |
request.set_header 'REQUEST_METHOD', 'PATCH' |
azure storage cors set -a [-beep-] -k [-beep-] --blob --cors "[{\"AllowedOrigins\":\"http://foo.bar.com, http://127.0.0.1:1234\",\"AllowedMethods\":\"GET\",\"MaxAgeInSeconds\":\"86400\",\"AllowedHeaders\":\"*\",\"ExposedHeaders\":\"*\"}]" |
#!/bin/bash | |
# https://stackoverflow.com/questions/28900078/upload-multi-file-from-linux-folder-to-azure-blob-storage | |
export AZURE_STORAGE_ACCOUNT='your_account' | |
export AZURE_STORAGE_ACCESS_KEY='your_access_key' | |
export container_name='name_of_the_container_to_create' | |
export source_folder=~/path_to_local_file_to_upload/* |
require 'nokogiri' | |
require 'open-uri' | |
50.times do | |
page = Nokogiri::HTML(open("http://www.matrix67.com/ideagen/")) | |
word = page.css('body .main p').children[0].to_s.gsub("\r",'').gsub("\n",'').gsub("\t",'').split('的')[1] | |
File.open('words','a'){ |file| file.write(word+"\n") } | |
end |