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
# あらかじめgraalvmのtar.gzをダウンロードしておく | |
# | |
# bundle exec ruby ./loop.rb | |
# bundle exec /usr/graalvm-1.0.0-rc1/bin/ruby ./loop.rb | |
FROM oraclelinux:7-slim | |
ENV GRAALVM_PKG=graalvm-ce-1.0.0-rc1-linux-amd64.tar.gz \ | |
JAVA_HOME=/usr/graalvm-1.0.0-rc1/jdk \ | |
PATH=/usr/graalvm-1.0.0-rc1/bin:$PATH \ | |
LANG=en_US.UTF-8 |
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
git clone https://github.com/ruby/ruby | |
./configure --prefix=${HOME}/.rbenv/versions/trunk --with-openssl-dir=/usr/local/opt/openssl | |
make | |
make install |
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
#!/usr/bin/env ruby | |
# Write loaded ruby file | |
File.write('./loaded_file.rb', 'puts :hello') | |
# load file and write iseq file | |
iseq = RubyVM::InstructionSequence.compile_file('./loaded_file.rb') | |
File.write('./loaded_file.yarb', iseq.to_binary) | |
# define load_iseq |
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
b = Bundler::LockfileParser.new(File.read('Gemfile.lock')) | |
b.specs.map { |s| "#{s.name} : #{s.version}" } |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <time.h> | |
int main(void) { | |
const int N = 50; | |
int n = 0; | |
for (;;) { |
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
#!/usr/bin/env ruby | |
require 'rake' | |
puts $LOAD_PATH | |
require 'bundler/setup' | |
puts '***********' | |
puts $LOAD_PATH | |
require 'rake' |
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
#!/bin/bash | |
set -ue | |
hostname=$(hostname) | |
if [[ ${hostname} != hoge.com ]]; then | |
echo "Error: bin/bundle_update はデプロイサーバで起動するスクリプトです" | |
exit 1; | |
fi |
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.5.0 | |
WORKDIR /root | |
RUN apt-get update | |
RUN apt-get install -y supervisor vim less nodejs | |
RUN gem install rails rake | |
RUN rails new app1 | |
RUN rails new app2 | |
RUN ln -s app1 current | |
RUN echo "app1" > app1/public/test.html |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<script src="https://code.jquery.com/jquery-3.3.1.min.js" | |
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" | |
crossorigin="anonymous"></script> | |
</head> | |
<body> | |
<form id="signup_form"> |
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
# app/assets/javascripts/channels/chat.js | |
var subscription = App.cable.subscriptions.create( | |
{ | |
channel: "ChatChannel", | |
room: "hogeroom" | |
}, | |
{ | |
connected: function() { | |
console.log('connected'); |