Skip to content

Instantly share code, notes, and snippets.

💸
work

Tim Paine timkpaine

💸
work
Block or report user

Report or block timkpaine

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View interval_to_cron.py
def interval_to_chron(interval, start_time):
if interval == Interval.MINUTELY:
# simple
return '*/1 * * * *'
elif interval == Interval.FIVE_MINUTES:
# simple
'*/5 * * * *'
elif interval == Interval.TEN_MINUTES:
return '{start_minute_mod_ten}-59/10 * * * *'.format(start_minute_mod_ten=start_time.minute % 10)
elif interval == Interval.THIRTY_MINUTES:
@timkpaine
timkpaine / .block
Last active Jan 31, 2019 — forked from JHawk/.block
Perspective Streaming Example
View .block
license: apache-2.0
View arrow code
import pyarrow as pa
import lantern as l
df = l.line()
df.head()
batch = pa.RecordBatch.from_pandas(df)
sink = pa.BufferOutputStream()
writer = pa.RecordBatchFileWriter(sink, batch.schema)
writer.write_batch(batch)
@timkpaine
timkpaine / iex.py
Last active Jul 10, 2019
Simple Real-Time Stock Streaming with Bokeh
View iex.py
'''
To run:
python -m bokeh serve iex.py
'''
import io
@timkpaine
timkpaine / rxpy - cycle timing
Last active May 7, 2019
Cycle-timing for rxpy
View rxpy - cycle timing
import time
def o1(x):
print("1: %s" % x)
return x
def o2(x):
print("2: %s" % x)
return x
You can’t perform that action at this time.