Skip to content

Instantly share code, notes, and snippets.

@satai
satai / montecarlo.scala
Last active July 28, 2023 12:43
Monte Carlo scala
import java.util
import java.util.concurrent.ThreadLocalRandom
// https://vtm.zive.cz/vtm/aspirin-nesnizuje-riziko-mrtvice-ale-naopak-zvysuje-riziko-krvaceni-do-mozku-zjistili-australsti-vedci/sc-869-a-223426/default.aspx?artcomments=1
object MonteCarlo {
@main
def main(): Any = {
println("start")
$ http GET https://onemocneni-aktualne.mzcr.cz/api/v2/covid-19/osoby.csv | grep '2020-0[1-5]' | wc -l
8990
satai@cerritos ~
$ http GET https://onemocneni-aktualne.mzcr.cz/api/v2/covid-19/osoby.csv | grep '2020-0[1-5]' | grep M | grep ',[7-9][0-9],' | wc -l
551
satai@cerritos ~
$ http GET https://onemocneni-aktualne.mzcr.cz/api/v2/covid-19/osoby.csv | grep '2020-09' | wc -l
42639
satai@cerritos ~
$ http GET https://onemocneni-aktualne.mzcr.cz/api/v2/covid-19/osoby.csv | grep '2020-09' | grep M | grep ',[7-9][0-9],' | wc -l
main :: IO ()
main = print "I'm here"
@satai
satai / 0_reuse_code.js
Created June 6, 2014 12:57
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
function man2kindle
cd /tmp ; and man $argv[1] | man2html > $argv[1].html ; and kindlegen $argv[1].html ; and mailsend -smtp SMTP_SERVER -f NAME@EXAMPLE.COM -name "YOUR NAME" -auth -user NAME -pass "PASS" -to NAME@kindle.com -sub $argv[1] -attach $argv[1].mobi ; and rm $argv[1].html $argv[1].mobi ; and cd -
end
@satai
satai / volby2.py
Last active December 11, 2015 18:29 — forked from starenka/volby2.py
#!/usr/bin/env python
import time
from pyquery import PyQuery as pq
while True:
def to_float(text):
return float(text.text.replace(',', '.'))
doc = pq(url='http://www.volby.cz/pls/prez2013/pe2?xjazyk=CZ')