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
ruby '2.7.1' | |
gem 'rails', github: 'rails/rails' | |
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
# Action Text | |
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
gem 'okra', github: 'basecamp/okra' | |
# Drivers |
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
TOKEN = '自分で取得してね' | |
CLIENT_ID = ID(数字) | |
# 通知用のチャンネルID | |
inform_channel = チャンネルID または '#チャンネルname' | |
# bot | |
bot = Discordrb::Commands::CommandBot.new token: TOKEN, client_id: CLIENT_ID, prefix:'/' | |
# 誰かがvoice channelに出入りしたら発火 |
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
やわらかRubyはCC BY 4.0 で提供します。 | |
詳細: https://creativecommons.org/licenses/by/4.0/deed.ja | |
This work is licensed under a Creative Commons Attribution 4.0 International License. | |
See also: https://creativecommons.org/licenses/by/4.0/deed |
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
# -*- coding: utf-8 -*- | |
source 'https://rubygems.org' | |
gem 'twitter' | |
gem 'natto' |
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> | |
<script type="text/javascript" src="./lib/jquery-1.9.1.min.js"></script> | |
<script type="text/javascript" src="./lib/peer.js"></script> | |
</head> | |
<body> | |
<form id="connect"> | |
<strong>connect to broker</strong><br> |
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
# ログインしてクッキー抽出 | |
def login(mail, pass) | |
host = 'secure.nicovideo.jp' | |
path = '/secure/login?site=niconico' | |
body = "mail=#{mail}&password=#{pass}" | |
https = Net::HTTP.new(host, 443) | |
https.use_ssl = true | |
https.verify_mode = OpenSSL::SSL::VERIFY_NONE | |
response = https.start { |https| |
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 "openssl" | |
class BF < Struct.new(:key, :pad_with_spaces) | |
def encrypt(str) | |
cipher = OpenSSL::Cipher.new('bf-ecb').encrypt | |
if pad_with_spaces | |
str += " " until str.bytesize % 8 == 0 | |
cipher.padding = 0 |
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
body { | |
font-family: Helvetica, arial, sans-serif; | |
font-size: 14px; | |
line-height: 1.6; | |
padding-top: 10px; | |
padding-bottom: 10px; | |
background-color: white; | |
padding: 30px; } | |
body > *:first-child { |
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 'sinatra' | |
require 'haml' | |
# 静的コンテンツ参照のためのパス設定 | |
set :public, File.dirname(__FILE__) + '/public' | |
# アップロード | |
get '/' do | |
haml :index |
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 'rubygems' | |
require 'sinatra' | |
require 'friendly' | |
Friendly.configure({ | |
:adapter => "sqlite", | |
:database => "database.sqlite3" | |
}) |
NewerOlder