Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| # | |
| # See also: http://almosteffortless.com/2008/12/11/easy-upload-via-url-with-paperclip/ | |
| # | |
| # Allow "uploads via url" with Rails and Paperclip | |
| # | |
| # http://www.thoughtbot.com/projects/paperclip | |
| # http://github.com/thoughtbot/paperclip/tree/master | |
| # http://groups.google.com/group/paperclip-plugin/browse_thread/thread/456401eb93135095 | |
| # | |
| # This example is designed to work with a "Photo" model that has an "Image" attachment |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| # encoding: UTF-8 | |
| # frozen_string_literal: true | |
| require 'net/http' | |
| require 'json' | |
| require 'uri' | |
| class HTTPDecorator | |
| # Timeouts | |
| OPEN_TIMEOUT = 10 # in seconds | |
| READ_TIMEOUT = 120 # in seconds |
| module Loggable | |
| extend ActiveSupport::Concern | |
| def log(message) | |
| return if Rails.env.test? | |
| Rails.logger.info "[#{current_timestamp}] [#{current_service_name}] #{message}\n" | |
| end | |
| private |
| alias gb="git branch --sort=-committerdate --verbose --format='%(HEAD) %(color:red)%(objectname:short)%(color:reset) - %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) - %(color:green)(%(committerdate:relative))%(color:reset) %(color:blue)<%(authorname)>%(color:reset)'" | |
| alias gba="gb -a" |
| require "benchmark" | |
| # https://github.com/rails/rails/pull/42761 | |
| class Execution | |
| TEST_FILE_PATH = "test/threshold_test.rb" | |
| SINGLE_TEST_DURATION = 0.1 | |
| attr_reader :threshold, :parallel | |
| def initialize(threshold, parallel: false) |
This guide will walk you through adding some extra features such as the ability to underline your text, or enhance your content by adding superscripts or subscripts for annotations or Math equations.
Prerequisites: Instruction guide assumes that you have created a Rails application and installed ActionText.
| source "https://rubygems.org" | |
| gemspec |
| class OAuth::GoogleAuthorizationsController < ApplicationController | |
| CLIENT_ID = Rails.application.credentials.google.client_id | |
| CLIENT_SECRET = Rails.application.credentials.google.client_secret | |
| SCOPE = "openid email profile" | |
| AUTHORIZATION_URL = URI("https://accounts.google.com/o/oauth2/v2/auth") | |
| TOKEN_URL = URI("https://www.googleapis.com/oauth2/v4/token") | |
| USER_INFO_URL = URI("https://www.googleapis.com/oauth2/v3/userinfo") | |
| before_action :validate_state_token, only: :show |