Skip to content

Instantly share code, notes, and snippets.

@KitaitiMakoto
KitaitiMakoto / Rakefile
Last active Jul 27, 2019
How to use wax_iiif
View Rakefile
file "build/#{name}/collection/top.json" do |task|
builder = WaxIiif::Builder.new(
base_url: "#{base_url}/#{name}",
output_dir: "build/#{name}",
verbose: true
)
records = Dir.glob("images/#{name}/**").collect {|path|
WaxIiif::ImageRecord.new(
id: File.basename(path),
path: path,
@KitaitiMakoto
KitaitiMakoto / Rakefile
Last active Jul 17, 2019
How to use wax_iiis
View Rakefile
file "build/001bj/collection/top.json" => ["images/001bj/001bj-210-0.png"] do |task|
builder = WaxIiif::Builder.new(
base_url: ENV["BASE_URL"],
output_dir: "build/001bj",
verbose: true
)
records = Dir.glob("images/001bj/**").collect {|path|
WaxIiif::ImageRecord.new(
id: File.basename(path),
path: path,
View group-by.rb
require "active_record"
config = {
adapter: "sqlserver",
host: "localhost",
port: 1433,
username: "sa",
password: "yourStrong(!)Password",
database: "groupby"
}
View group-by.rb
require "active_record"
config = {
adapter: "sqlserver",
host: "localhost",
port: 1433,
username: "sa",
password: "yourStrong(!)Password",
database: "groupby"
}
View group-by.rb
require "active_record"
config = {
adapter: "sqlserver",
host: "localhost",
port: 1433,
username: "sa",
password: "yourStrong(!)Password",
database: "groupby"
}
View file0.txt
% ruby-install ruby-2.3.3
View fluentd.rb
require 'rouge/lexers/fluentd/version'
module Rouge
module Lexers
class Fluentd < Apache
title "Fluentd"
desc "configuration files for Fluentd"
tag "fluentd"
filenames "fluent.conf", "td-agent.conf"
View fluent-config.html
<div class="highlight"><pre><span class="nt">&lt;source&gt;</span>
<span class="nb">type</span> ping_message
<span class="nb">data</span> ${hostname}
<span class="nb">tag</span> ping
<span class="nb">interval</span> <span class="m">60</span>
<span class="nt">&lt;/source&gt;</span>
<span class="nt">&lt;match</span> <span class="s">app.**,ping</span><span class="nt">&gt;</span>
<span class="nb">type</span> forward
<span class="nt">&lt;server&gt;</span>
View apply-patch.rb
require "English"
require "json"
require "epub/ocf/physical_container/zipruby"
require "epub/parser"
require "epub/parser/cfi"
require "epub/maker"
require "rouge"
require "rouge/lexers/fluentd"
def main(argv)
View logbook.epubpatch.json
{
"schema-version": "0.5.0",
"modified": "2016-06-03T00:00:00Z",
"target": "urn:uuid:5847863b-7653-4319-8c0b-ccee8a1dcac3@2014-08-08T09:00:00Z",
"patch": [
{"op": "replace", "cfi": "/6/20!/4/2/42/2", "value": "", "lang": "ruby"},
{"op": "replace", "cfi": "/6/20!/4/2/80/2", "value": "", "lang": "fluentd"},
{"op": "replace", "cfi": "/6/20!/4/2/94/2", "value": "", "lang": "fluentd"},
{"op": "replace", "cfi": "/6/30!/4/2/70/2", "value": "", "lang": "json"},
{"op": "replace", "cfi": "/6/30!/4/2/126/2", "value": "", "lang": "fluentd"},