Skip to content

Instantly share code, notes, and snippets.

@adash333
adash333 / Dockerfile
Last active Jan 30, 2022
Docker Ruby 2.5 on Rails 5.0.3
View Dockerfile
# Docker Ruby 2.5 on Rails 5.0.3 (ProgateのRuby on Rails 5 学習レッスンとほぼ同じ環境)
FROM ruby:2.5
# Rails6ではnodejsとyarnはwebpackをインストールする際に必要
# yarnパッケージ管理ツールをインストール
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update -qq && apt-get install -y nodejs build-essential libpq-dev postgresql-client yarn
WORKDIR /myapp
@adash333
adash333 / Gemfile
Created Jan 30, 2022
Progate Ruby on Rails 5 学習レッスン
View Gemfile
source 'https://rubygems.org'
gem 'rails', '5.0.3'
# Use Puma as the app server
gem 'puma', '3.6.2'
# Use SCSS for stylesheets
gem 'sass-rails', '5.0.6'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '3.0.4'
gem 'pry-rails', '0.3.4'
@adash333
adash333 / Dockerfile
Last active Jan 28, 2022
Docker Ruby 2.5 on Rails 5.1.6
View Dockerfile
# Docker Ruby 2.5 on Rails 5.1.6
FROM ruby:2.5
# Rails6ではnodejsとyarnはwebpackをインストールする際に必要
# yarnパッケージ管理ツールをインストール
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update -qq && apt-get install -y nodejs build-essential libpq-dev postgresql-client yarn
WORKDIR /myapp
@adash333
adash333 / Dockerfile
Created Jan 27, 2022
Docker Ruby 2.7 on Rails 6
View Dockerfile
# Ruby 2.7 on Rails 6
FROM ruby:2.7.4
# Rails6ではnodejsとyarnはwebpackをインストールする際に必要
# yarnパッケージ管理ツールをインストール
# yarnパッケージ管理ツールをインストール
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update -qq && apt-get install -y nodejs build-essential libpq-dev postgresql-client yarn
@adash333
adash333 / Dockerfile
Last active Jan 23, 2022
Docker Ruby 3.1 on Rails 7
View Dockerfile
# Ruby 3.1 on Rails 7
FROM ruby:3.1.0
RUN apt-get update -qq && apt-get install -y nodejs postgresql-client
WORKDIR /myapp
COPY Gemfile /myapp/Gemfile
COPY Gemfile.lock /myapp/Gemfile.lock
RUN bundle install
# コンテナー起動時に毎回実行されるスクリプトを追加
COPY entrypoint.sh /usr/bin/
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Hello Bulma!</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.1/css/bulma.min.css">
</head>
<body>
<section class="section">
View predict.js
const CLASSES = {0:'Apple', 1:'MikanOrange'}
//-----------------------
// start button event
//-----------------------
$("#start-button").click(function(){
loadModel() ;
startWebcam();
});
View main.dart
import 'package:flutter/material.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
View flutter-web_firestore_list.main.dart
import 'package:flutter/material.dart';
import 'package:firebase/firebase.dart';
import 'package:firebase/firestore.dart' as fs;
// initializeApp()の中身は、ご自身の設定に書き換えてください。
void main() {
initializeApp(
apiKey: "YourApiKey",
authDomain: "YourAuthDomain",
databaseURL: "YourDatabaseUrl",
View flutter-web_firestore_list
import 'package:flutter/material.dart';
import 'package:firebase/firebase.dart';
import 'package:firebase/firestore.dart' as fs;
void main() {
initializeApp(
apiKey: "YourApiKey",
authDomain: "YourAuthDomain",
databaseURL: "YourDatabaseUrl",
projectId: "YourProjectId",