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 | |
for arg; do | |
dir=${arg} | |
# ffmpeg -framerate 60 -i $dir/seq%06d.jpg -vf deflicker=s=10:m=2 -c:v hevc_videotoolbox -b:v 200000k -tag:v hvc1 $dir.mp4 | |
ffmpeg -framerate 60 -pattern_type glob -i "$dir/seq*.jpg" -vf deflicker=s=10:m=2 -c:v hevc_videotoolbox -b:v 200000k -tag:v hvc1 $dir.mp4 | |
done |
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(class=tw.text.px_4.py_2.hover__text_gray_200) | |
button(class=tw.btn.btn_primary) CLICK! |
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 'jwt' | |
def generate_instant_token(topic, password: '') | |
sdk_key = ENV['ZOOM_SDK_KEY'] | |
sdk_secret = ENV['ZOOM_SDK_SECRET'] | |
iat = Time.now.to_i | |
exp = iat + 60 * 60 * 2 |
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 'tmpdir' | |
require 'shellwords' | |
webloc_file = ARGV[0] | |
webloc_ext = File.extname(webloc_file) | |
webarchive_file = webloc_file.gsub(/#{webloc_ext}$/, '.webarchive') | |
url = nil |
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
class CreateOpenBds < ActiveRecord::Migration | |
def change | |
create_table :open_bds do |t| | |
t.string :isbn, null: false | |
t.jsonb :content | |
t.datetime :last_crawled_at | |
t.timestamps null: false | |
end | |
add_index :open_bds, :isbn, unique: true | |
add_index :open_bds, :content, using: :gin |
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 d3 | |
var height = 500; | |
var width = 800; | |
var margin_left = 20; | |
var xdim = 2; | |
var svgContianer = d3.select("body") | |
.append("svg") | |
.attr("width", width) |
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
t = 236 # seconds | |
Time.at(t).utc.strftime("%H:%M:%S") | |
=> "00:03:56" | |
# Reference | |
# http://stackoverflow.com/questions/3963930/ruby-rails-how-to-convert-seconds-to-time |
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
list = `convert 9784152097712_10.jpg -format %c histogram:info:`.split("\n") | |
rgbs = list.map { |line| $1 if line =~ /\s+#([\dA-F]+)\s+/ } | |
num_non_gray = rgbs.select { |rgb| | |
r = rgb[0,2]; g = rgb[2,2]; b = rgb[4,2] | |
r != g || g != b | |
}.count | |
num_non_gray > 0 # true: 正しい画像, false: (一色かどうかはわからないが)グレー画像 |
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
// Responsiveness | |
$tablet: 769px !default | |
// 960px container + 40px | |
$desktop: 1000px !default | |
// 1152px container + 40 | |
$widescreen: 1192px !default | |
// 960 and 1152 have been chosen because | |
// they are divisible by both 12 and 16 |
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
gem 'request_store' |