This file contains hidden or 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
hash_input = {"a.b" => "value", "a.c" => "hoge", "b.1" => "a", "a.b.c" => "aa"} | |
hash_output = {} | |
ENABLE_OVERRIDE = true | |
hash_input.each do |key, value| | |
key_splits = key.split(".") | |
current_hash = hash_output | |
key_splits_tmp = key_splits.dup | |
key_splits_tmp.delete_at(key_splits.size - 1) # remove last value |
This file contains hidden or 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 "csv" | |
sql = 'UPDATE servers SET status="suspended" WHERE status IS NULL' | |
CSV.foreach("test.csv") do |row| | |
sql += ' AND NOT uuidShort="' + row[0] + '"' | |
end | |
puts sql |
This file contains hidden or 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 "csv" | |
words = [] | |
CSV.foreach("test.csv") do |row| | |
words << row[0] unless row[0].nil? | |
words << row[1] unless row[1].nil? | |
words << row[2] unless row[2].nil? | |
end |
This file contains hidden or 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 'sqlite3' | |
DB_FILE_NAME = "test.db" | |
$db = SQLite3::Database.new(DB_FILE_NAME) | |
# 初期化(テーブル作成) | |
def init | |
sql = <<~'SQL' | |
CREATE TABLE IF NOT EXISTS users( |
This file contains hidden or 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
<?php | |
/** | |
* @name TargetBlock | |
* @version 1.0.0 | |
* @main pjz9n\test\targetblock\Main | |
* @api 3.0.0 | |
*/ | |
declare(strict_types=1); |
This file contains hidden or 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
<div class="container-fluid py-4"> | |
<div class="row"> | |
<div class="col-sm-7 col-lg-9 order-sm-2"> | |
<div class="card bg-dark border-dark rounded-lg"> | |
<div class="card-header bg-info"> | |
<h3 class="card-title">Foobar</h3> | |
</div> | |
<div class="card-body"> | |
<div class="container py-2"> | |
<div class="card bg-dark border-dark"> |
This file contains hidden or 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
<div class="text-center"> | |
<div class="container"> | |
<%= bootstrap_form_with url: '/test1' do |f| %> | |
<%= f.email_field :email %> | |
<%= f.password_field :password %> | |
<%= f.check_box :remember_me %> | |
<br> | |
<%= invisible_recaptcha_tags text: '<i class="fas fa-paper-plane"></i> 送信', class: 'btn btn-success' %> | |
<% end %> | |
</div> |
This file contains hidden or 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
<?php | |
use dktapps\pmforms\CustomForm; | |
use dktapps\pmforms\CustomFormResponse; | |
use dktapps\pmforms\element\Input; | |
use pocketmine\Player; | |
$form = new CustomForm( | |
"example", | |
[ |
This file contains hidden or 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
<?php | |
declare(strict_types=1); | |
namespace pjz9n\classbasedpmforms; | |
use pocketmine\Player; | |
class ExampleForm extends ModalForm | |
{ |
NewerOlder