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 Array | |
def generate_color(num, reg) | |
each.with_index(num) do |hexcolor, termcolor| | |
number = "#{termcolor}".ljust(3) | |
bg = "\e[48;5;#{termcolor}m \e[0m" | |
fg = "\e[38;5;#{termcolor}m #{number} ##{hexcolor} \e[0m" | |
print bg + fg | |
print "\n" if reg =~ hexcolor | |
end | |
end |
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
ARGF.each_line do |line| | |
puts line.gsub(/[ ]+/, ' ').rstrip | |
end |
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
" lightline colorscheme | |
" Name: eva01 | |
" Author: hachy | |
" License: MIT License | |
let s:purple1 = [ '#875faf', 97 ] | |
let s:purple2 = [ '#af5fff', 135 ] | |
let s:green = [ '#87ff5f', 119 ] | |
let s:orange = [ '#d7af5f', 179 ] | |
let s:red = [ '#d75f87', 168 ] |
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
aiueo = "aiueokgsztdnhbpmyrw" | |
alpha = "a-s" | |
nogizaka = %w(shiraishimai akimotomanatsu matsumurasayuri ikomarina hatanakaseira itounene itoumarika itoukarin itoujunna ikutaerika) | |
puts nogizaka.sort_by { |name| name.tr(aiueo, alpha) } | |
# => akimotomanatsu | |
# => ikutaerika | |
# => ikomarina |
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
- flash.each do |key, value| | |
%div{class: "alert alert-#{key} alert-dismissable"} | |
= value | |
%button.close(type="button" data-dismiss="alert" aria-hidden="true") | |
× |
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
romaji = %w(manatsu.akimoto erika.ikuta rina.ikoma rena.ichiki nene.ito marika.ito sayuri.inoue misa.eto hina.kawago mahiro.kawamura hinako.kitano asuka.saito chiharu.saito yuuri.saito reika.sakurai mai.shiraishi mai.shinuchi kazumi.takayama kana.nakada himeka.nakamoto seira.nagashima nanase.nishino ami.noujo nanami.hashimoto seira.hatanaka hina.higuchi mai.fukagawa minami.hoshino miona.hori sayuri.matsumura rina.yamato yumi.wakatsuki maaya.wada) | |
kanji = %w(秋元真夏 生田絵梨花 生駒里奈 市來玲奈 伊藤寧々 伊藤万理華 井上小百合 衛藤美彩 川後陽菜 川村真洋 北野日奈子 齋藤飛鳥 斎藤ちはる 斉藤優里 桜井玲香 白石麻衣 新内眞衣 高山一実 中田花奈 中元日芽香 永島聖羅 西野七瀬 能條愛未 橋本奈々未 畠中清羅 樋口日奈 深川麻衣 星野みなみ 堀未央奈 松村沙友理 大和里菜 若月佑美 和田まあや) | |
# puts member = romaji.zip(kanji).to_h | |
last = romaji.length | |
print '{ ' | |
romaji.zip(kanji).each_with_index do |(k, v), i| |
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 install nogizaka_blog | |
# https://github.com/hachy/nogizaka_blog | |
require 'optparse' | |
require 'nogizaka_blog' | |
def run | |
ym = @nogi.yearmonth | |
puts "#{ym[0..3]}/#{ym[4..5]}" | |
header = display_format('name', 'comment', 'article') | |
puts header |
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 'yaml' | |
data = YAML.load_file('sakana.yml') | |
data.keys.each do |k| | |
puts "<item>#{k}</item>" | |
end | |
data.values.each do |v| | |
puts "<item>#{v}</item>" |
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
file_name = 'kokumei_0.txt' | |
quiz_list_name = 'kokumei_0' | |
kanji = [] | |
yomi = [] | |
File.open(file_name).each_line do |line| | |
a, b = line.split(' ') | |
kanji << a | |
yomi << b |
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
member = %w( | |
秋元真夏 | |
生田絵梨花 | |
生駒里奈 | |
伊藤かりん | |
伊藤純奈 | |
伊藤万理華 | |
井上小百合 | |
衛藤美彩 | |
川後陽菜 |
OlderNewer