This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"code_snippets": [ | |
"bundle exec rails db:migrate", | |
"bundle install", | |
"docker compose build", | |
"kubectl get pods -n dev", | |
"RAILS_ENV=production bundle exec rails c" | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'faraday' | |
module FukuokaToshokan | |
class Client | |
def initialize | |
default_headers = { | |
'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', | |
'Accept-Language' => 'ja-JP,ja;q=0.9,en-US;q=0.8,en;q=0.7', | |
'Cache-Control' => 'max-age=0', | |
'Connection' => 'keep-alive', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'osc-ruby' | |
def play(sound) | |
client = OSC::Client.new('localhost', 51235) | |
client.send(OSC::Message.new('/run-code', 'DEMO', "play #{sound}")) | |
end | |
require 'concurrent' | |
def kaeru | |
Concurrent::Promises.future do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM mcr.microsoft.com/playwright:v1.14.1 | |
RUN mkdir /playwright | |
WORKDIR /playwright | |
RUN npm install [email protected] | |
RUN echo '{ "port": 8080 }' > config.json | |
EXPOSE 8080 | |
CMD ./node_modules/.bin/playwright launch-server chromium config.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'playwright' | |
force_login = false | |
Playwright.connect_to_playwright_server('ws://127.0.0.1:8000/ws') do |playwright| | |
playwright.chromium.launch(headless: false, channel: 'chrome-canary') do |browser| | |
page = browser.new_page | |
page.goto('https://vaccines.sciseed.jp/fukuokacity/') | |
require 'pry' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openapi: 3.0.1 | |
info: | |
title: エンジニア・プログラマにしか使えないSNS | |
description: | | |
通常のSNSで胡散臭い人が多いと感じてしまいました | |
プログラミングスクールが流行り、エンジニアになって億稼いでます!みたいな・・・ | |
そこで、本当のエンジニア・プログラマしか使えないSNSを作ってみました! | |
つまり、WebApi提供のみのSNSです | |
一般ピープルが使うようなフロントエンドなんてありません!! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
feature_files = Dir.glob('features/**/*.feature') | |
step_files = Dir.glob('steps/**/*_steps.rb') | |
Usage = Struct.new(:feature, :scenario, :step) | |
StepUsageItem = Struct.new(:step_description, :usages) | |
require 'turnip' | |
# 全Featureを読み、それぞれのstepがどのfeature/scenario で使われているかを調べる。 | |
step_usage = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open3' | |
Open3.popen3("ping", "google.com") do |stdin, stdout, stderr, wait_thr| | |
stdin.close | |
while std_ready_list = IO.select([stderr, stdout])&.first | |
std_ready_list.each do |std| | |
puts ">> #{std.readline}" | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// yarn init -y | |
// yarn add puppeteer-core | |
const puppeteer = require("puppeteer-core"); | |
const launchChrome = puppeteer.launch({ | |
// MacにインストールされているChromeを使う。 | |
executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', | |
// ブラウザ画面を表示しながら(ヘッドレスモードを無効にする)。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ruby:2.6-alpine | |
RUN mkdir /usr/src/app | |
WORKDIR /usr/src/app | |
RUN bundle init | |
RUN sed -i -e 's/# gem "rails"/gem "rails"/' Gemfile | |
# For installing Nokogiri (ref: https://copo.jp/blog/2016/03/alpine-%E3%81%AE-ruby-%E3%81%AE%E3%82%A4%E3%83%A1%E3%83%BC%E3%82%B8%E3%81%AB-nokogiri-%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB/ ) | |
RUN apk add --no-cache build-base libxml2-dev libxslt-dev |
NewerOlder