- Railsにプルリクストを送るときに知っておくと便利なお作法集
- Railsにプルリクエストを送りたいけど何から始めたらいいのかわからない人向けの指針
お作法についてはRuby on Rails に貢献する方法 | Rails ガイドを参考にしています。
Railsのコードを読むには、最低限次の二つの知識があったほうがよいです
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from moviepy.editor import * | |
| from matplotlib import animation as ani | |
| sigma = 1 | |
| mu = 3 | |
| def norm_dist_neg(x): | |
| return -1./(np.sqrt(2 * np.pi) * sigma)* np.exp(-0.5*((x-mu)**2)/((sigma**2))) |
| 'use strict' | |
| var gulp, sass, babelify, browserify, watchify, source, util; | |
| gulp = require('gulp'); | |
| sass = require('gulp-sass'); | |
| babelify = require('babelify') | |
| browserify = require('browserify'); | |
| watchify = require('watchify'); | |
| source = require('vinyl-source-stream'); |
| # Before | |
| Rails.application.config.assets.version = '1.0' | |
| Rails.application.config.assets.paths << Emoji.images_path | |
| Rails.application.config.assets.precompile += %w( search.js ) | |
| # After | |
| Rails.application.config.assets.tap do |assets| | |
| assets.version = '1.0' | |
| assets.paths << Emoji.images_path | |
| assets.precompile += %w( search.js ) |
| # Wouldn't it be great if you could have STI like functionality | |
| # without needing to encode strings of class names in the database? | |
| # Well today is your lucky day! Discriminable Model is here to help. | |
| # | |
| # Simply specify your models desired type column, and provide a block to | |
| # do the discrimination. If you want the whole STI-esque shebang of properly | |
| # typed finder methods you can supply an array of 'discriminate_types' that will | |
| # be used to apply an appropriate type. | |
| # | |
| # class MyModel < ActiveRecord::Base |
| # Typical setup to include TensorFlow. | |
| import tensorflow as tf | |
| # Make a queue of file names including all the JPEG images files in the relative | |
| # image directory. | |
| filename_queue = tf.train.string_input_producer( | |
| tf.train.match_filenames_once("./images/*.jpg")) | |
| # Read an entire image file which is required since they're JPEGs, if the images | |
| # are too large they could be split in advance to smaller files or use the Fixed |
| #!/usr/bin/env ruby | |
| require 'openssl' | |
| require 'base64' | |
| require './worker.rb' | |
| $urls = %w( | |
| http://www.aozora.gr.jp/cards/001779/files/56647_ruby_58166.zip | |
| http://www.aozora.gr.jp/cards/000148/files/752_ruby_2438.zip | |
| http://www.aozora.gr.jp/cards/001383/files/56866_ruby_58168.zip |
お作法についてはRuby on Rails に貢献する方法 | Rails ガイドを参考にしています。
Railsのコードを読むには、最低限次の二つの知識があったほうがよいです
|  | |
| $n$を正の整数とする。$n$を割り切る正の整数が$1$個しかないとき、$n$を<b>単数</b>という。ちょうど$2$個あるとき、$n$を<b>素数</b>という。$3$個以上あるとき、$n$を<b>合成数</b>という。 | |
| $$ | |
| \begin{array}{|c|c|c|c|c|c|c|c|c|c} | |
| \hline | |
| \textbf{単数} & 1 & & & & & & & & & & \\ | |
| \hline | |
| \textbf{素数} & & 2 & 3 & & 5 & & 7 & & & & \\ | |
| \hline | |
| \textbf{合成数} & & & & 4 & & 6 & & 8 & 9 & 10 & \\ |
$ echo 'gem "webpacker"' >> Gemfile
$ bundle install
$ rails webpacker:install
$ yarn add [email protected] jquery popper.jsdiff --git a/config/webpack/environment.js b/config/webpack/environment.js
index d16d9af..86bf1a7 100644| 'use strict'; | |
| exports.handler = (event, context, callback) => { | |
| // Get request and request headers | |
| const request = event.Records[0].cf.request; | |
| const headers = request.headers; | |
| // Configure authentication | |
| const authUser = 'user'; | |
| const authPass = 'pass'; |