Skip to content

Instantly share code, notes, and snippets.

View 844196's full-sized avatar

Masaya Takeda 844196

  • 株式会社ヴァジラ・アヌッタラ ヒタ アビヴッディ精密機器工業
  • Sapporo, Japan
  • 16:00 (UTC +09:00)
  • X @efumaxay
View GitHub Profile
@844196
844196 / 01_input.csv
Last active January 25, 2016 19:49
配列を渡すと、先頭からブロック内の条件に一致する要素を返し、同時に配列から取り除くメソッド
エージェント ログオンユーザー 日付 イベント時刻
PC_A UserA 2000/01/01 00:00:00
PC_A UserA 2000/01/01 01:00:00
PC_A UserA 2000/01/01 02:00:00
PC_C UserA 2000/01/01 02:30:00
PC_C UserA 2000/01/01 03:00:00
PC_A UserB 2000/01/01 04:00:00
PC_C UserA 2000/01/01 04:30:00
PC_A UserB 2000/01/01 05:00:00
PC_A UserB 2000/01/01 06:00:00
require 'yaml'
require 'csv'
require 'date'
require 'time'
require 'singleton'
module LogParser
class Configuration
# 設定メソッド
# LogParser#configure, LogParser#yaml_load
require 'pp'
regexp = /
\A
(?<faculty>a[khut])
(?<join_year>\d{1,2})
(?<department>\d{2})
(?<range_number>\d{3})
\z
/xi
require 'thor'
class Renge
include Enumerable
def initialize(file_obj)
@quotes = file_obj.readlines.map(&:chomp)
end
def each(&block)
@844196
844196 / coma-chan.md
Last active November 28, 2015 05:03
コマちゃんをいい感じに表示させたい人生だった

コマンドブロックちゃんが喋ってる感じにしたかったけど、これじゃない感と見にくさが出てしまった。
― saveDefaultConfig()をkorose

GitHub(Gist含む)内のMarkdownでは、styleを適用できないので難しい

code

<table>
 
require 'n_cipher'
puts :encode
p NCipher.encode(
'見えるかな?',
seed: "\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A",
delimiter: "\u00A0"
)
puts :decode
@844196
844196 / gist:3b87ea8fb186088eefcd
Created October 19, 2015 12:54
慳増覬ハ畏歙帚茄ス倢且囎ツ旙影峻縫ロ淀榎ア榮フニャ興薜紛セヒ肴黙塊蕨ァ浮薀
且以佖倆倍倢僞冉冦刕励勃勅勉叝吠啝喃嗚嗷囎塊増墨女婁嬲寐岑岬岺峻嵭巐帚帰幕建彑影往心忍忘悅悍悟悴慳搭搴撰擇擠擶攝旒旙昮朧株桒桷棟楓楠榎榮樞橘橾檢櫤歙殃毘氷汐沒浮浴浸淀湮溪潦濾瀑烙烽熔犖狆狛猛獪珎申畏畷疥疽癸瞳碎磋磨礎移稷穩竧筌紅紘紛組緻縫縲聾肴興舍芻茄茘莢莽葩葺蕨薀薜藏蝴螽袂裼褊覬訛語謠赦赴這遽釛鉎銖鋠錡鏆鏝霊霏靕靠顔駿驃髏鬲鯨鶴鹹黙黠﨡ヲァィゥェォャュョッアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムモヤユヨラリルレロワン
@844196
844196 / hige_typing.rb
Last active October 24, 2015 15:02
もしもそれが、ひげの様に喋って、ひげの様にうどんを食べるのであれば、それはひげである。
class Keepoff
def udon
'うどん'
end
end
class Hyousikinuko
def udon
'うどん'
end
@844196
844196 / 01_scheme.sql
Last active September 3, 2015 13:40
SQL ダミーテーブルの生成からレコード抽出まで http://sqlfiddle.com/#!9/4c9af/12
CREATE TABLE `users` (
`id` INTEGER PRIMARY KEY AUTO_INCREMENT,
`section_cd` INTEGER(1),
`username` VARCHAR(255),
`mail_address` VARCHAR(255),
`delete_flg` INTEGER(1),
`created_at` DATETIME
);
INSERT INTO `users` () VALUES (), (), (), (), ();
@844196
844196 / style.css
Last active January 24, 2021 02:56
/*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;