Skip to content

Instantly share code, notes, and snippets.

View jmettraux's full-sized avatar

John Mettraux jmettraux

View GitHub Profile
.right {
color: blue;
font-weight: bold;
}
table {
width: 60%;
margin: auto;
border: 1px solid black;
#
# MIT License - (c) 2011 John Mettraux
#
require 'rubygems'
require 'parslet' # gem install parslet
module MyJson
@jmettraux
jmettraux / out.txt
Last active January 7, 2020 08:59
flor hook vs require:
-sch-sch-sch-sch-sch-sch-sch-sch-sch-sch-sch-sch-sch-sch-sch-sch-sch-sch-sch
+ error in Flor::Scheduler#notify
#<NameError: uninitialized constant Flor::PoloZeroHook>
/Users/jmettraux/w/flor/lib/flor/unit/hook.rb:106:in `instantiate'
/Users/jmettraux/w/flor/lib/flor/unit/hook.rb:67:in `class_to_hook'
/Users/jmettraux/w/flor/lib/flor/unit/hook.rb:18:in `to_hook'
/Users/jmettraux/w/flor/lib/flor/core/executor.rb:131:in `collect'
/Users/jmettraux/w/flor/lib/flor/core/executor.rb:131:in `traps_and_hooks'
/Users/jmettraux/w/flor/lib/flor/unit/hooker.rb:65:in `notify'
/Users/jmettraux/w/flor/lib/flor/unit/scheduler.rb:385:in `notify'
class Fugit::Cron
def previous_time(from=::EtOrbi::EoTime.now)
from = ::EtOrbi.make_time(from)
ti = 0
ifrom = from.to_i
t = TimeCursor.new(from.translate(@timezone))
# a gem freeze module
# (couldn't find one [I liked], so wrote it)
# original is at http://gist.github.com/87639
#
# usage example :
# http://tinyurl.com/ddzvyz
# http://tinyurl.com/cxukck
#--
--
-- lena.lua
--
--
-- work queue operations
queue = {}
19:54 puppeh has joined (~puppeh@....gr)
19:55 puppeh: can I ask about rufus-scheduler?
19:58 puppeh: I try to do a :first_in => Time.now but it throws: cannot set first[_at|_in] in the past: 1.0e-07 -> 2014-01-22 10:44:32 +0000 (ArgumentError)
19:58 puppeh: I want to run the job to be run immediately the first time
19:59 jmettraux: puppeh: hello, welcome to #ruote
20:00 jmettraux: if you want it to run immediately, don't set any :first_in
20:01 puppeh: so this: scheduler.every '10s' do
20:01 puppeh: will run immediately the first time and then after each 10" ?
20:02 jmettraux: unfortunately, it will run for the first time after 10 seconds
20:02 puppeh: that's what I'm talking about :P
source 'https://rubygems.org'
gem 'yajl-ruby'
gem 'ruote'
@jmettraux
jmettraux / Gemfile
Last active December 23, 2015 09:49 — forked from ypz/ack.rb
source 'https://rubygems.org'
gem 'yajl-ruby'
gem 'ruote'
def test_update_workitem_alt
@dashboard.register_participant 'alpha', Ruote::StorageParticipant
wfid = @dashboard.launch(Ruote.process_definition { alpha })
wait_for(:alpha)
#wi = @dashboard.process(wfid).workitems.first
#alpha = @dashboard.participant(wi.participant_name)