Skip to content

Instantly share code, notes, and snippets.

View Neonik47's full-sized avatar

Dmitry Volodin Neonik47

View GitHub Profile
@Neonik47
Neonik47 / wol.rb
Created October 4, 2015 09:15 — forked from zunda/wol.rb
A ruby script which sends out a magic packet to wake up your PC
#!/usr/bin/ruby
# wol.rb: sends out a magic packet to wake up your PC
#
# Copyright (c) 2004 zunda <zunda at freeshell.org>
#
# This program is free software. You can re-distribute and/or
# modify this program under the same terms of ruby itself ---
# Ruby Distribution License or GNU General Public License.
#
class SearchByDocType
constructor: () ->
doc_type_select_listener()
doc_type_select_listener = () ->
def = new SearchByDocType.Default
first_type = new SearchByDocType.FirstType
second_type = new SearchByDocType.SecondType
if $('#document_type').length > 0
def testo(&block)
min_time = nil
total_time = 0
1000.times do
break if total_time > 10
ti1 = Time.now
res = block.call
ti2 = Time.now
if res == -1
min_time = -1