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
#coding:utf-8 | |
require "watir" | |
nya = [ | |
"スレッドタイトル1" , "内容1" , | |
"スレッドタイトル2" , "内容2" , | |
].*(10) | |
time = 1024 | |
agent = Watir::Browser.new :ie |
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
#coding:utf-8 | |
# | |
# 2015 10 02 | |
# watir_sample.rb | |
# https://gist.github.com/ir-norn/e1968bb305aa8d03e1e5 | |
# | |
require "watir" | |
require "kconv" | |
require "open-uri" |
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
atom.commands.add 'atom-text-editor', | |
'user:paste-results-as-comment': -> | |
editor = atom.workspace.getActiveTextEditor() | |
editorElement = atom.views.getView(editor) | |
atom.commands.dispatch editorElement, 'script:copy-run-results' | |
text = atom.clipboard.read() | |
editor.insertText(text.replace(/\[Finished.*\]/gm, '')) |
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
module Merkle_tree_m | |
include Tree_task_search_m | |
attr_accessor :sym , :up , :func , :task , :n | |
# TREE TASK SYSTEM ADD variables | |
attr_accessor :Flandoll , :Scarlet # Message_Q / Scene間のデータ移動 | |
def initialize hs = Hash.new , &block | |
@sym = hs[:sym] | |
@up = hs[:up] | |
@func = block |
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
0008,PanelHideAll | |
0009,PanelHideAll | |
0021,ViewZoomInCurPos | |
0022,ViewZoomOutCurPos | |
0023,ViewRotateR | |
0024,ViewHome | |
002d,ViewRotateReset | |
002e,ViewRotateL | |
0030,Undo | |
0031,BrushSizeDown |
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
# Fiberによるイベントプロシージャの実装(簡易版) | |
### コンストラクタ | |
@ev = event_proc | |
def event_proc | |
Fiber.new do loop do | |
code , *arg = Fiber.yield | |
case code | |
when :VK_0 | |
p :test |
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
<script type="text/javascript" language="javascript"><!-- | |
var count = function(num) { | |
hs = new Array(); | |
return { | |
getNum: function( key ) { | |
if( !hs[key] ){ hs[key] = 0; } | |
return hs[key]++; | |
}, | |
Num: function(key) { |
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
#coding:utf-8 | |
# https://ja.m.wikipedia.org/wiki/Help:%E3%83%9A%E3%83%BC%E3%82%B8%E3%81%AE%E7%B7%A8%E9%9B%86 | |
text=<<TEXT | |
:コロンで始まる行は字下げされます。改行しない限り、同じ深さで表示されます。 | |
::コロンを追加すると、さらに深く字下げされます。 | |
::同じ個数のコロンを使うと、同じ深さの字下げになります。 | |
:::あまり深くなり過ぎると、 | |
::::読みづらくなるかもしれません。 | |
::Sample | |
:::文章 |
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
# https://bugs.ruby-lang.org/issues/8987 | |
module Kernel | |
def λ expr | |
eval("->x{ #{expr} x}") | |
end | |
end | |
p [1, 2, 3, 4].map(&λ("4+")) #=> [5, 6, 7, 8] |
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 'forwardable' | |
class MyQueue | |
extend Forwardable | |
def initialize | |
@queue = [] | |
end | |
def_delegators :@queue , :push, :<<, :shift, | |
:first, :last ,:size , :clear, :to_a |