Skip to content

Instantly share code, notes, and snippets.

View korenmiklos's full-sized avatar

Miklós Koren korenmiklos

View GitHub Profile
@korenmiklos
korenmiklos / README.md
Created November 24, 2012 19:50 — forked from mbostock/.block
Multi-Series Line Chart
@korenmiklos
korenmiklos / ajax.html
Last active December 11, 2015 17:18
Prototype of Graphing App
<!DOCTYPE html>
<meta charset="utf-8">
<html><head>
<script src="http://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<script>
d3.json("http://htsql.coauthors.net/htsql/industry?country='austria'/:json", function(d) { console.log(d);});
</script>
</body>
# -*- coding: utf-8 -*-
import sys
import re
import csv
where_regex = r"""(In <a href="(?P<url>.*?)">(?P<folder>.*?)</a>, )?"""
who_regex = r"(?P<who>.*?)"
verb_regex = r"(?P<verb>added|edited|deleted|moved|renamed) "
what_regex = r"""(the (file|folder) )?(.*?)<a (.*?) title="(?P<what>.*?)">(.*?)</a>\. """
when_regex = r"(?P<when>.*)$"
@korenmiklos
korenmiklos / button.css
Last active December 31, 2015 22:09 — forked from lgrammel/button.css
button {
font: 14px Helvetica Neue;
background-color: #222;
background-image: -moz-linear-gradient(top, rgba(255,255,255,.25), rgba(255,255,255,.11));
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, rgba(255,255,255,.25)),color-stop(1, rgba(255,255,255,.11)));
background-image: -webkit-linear-gradient(rgba(255,255,255,.25), rgba(255,255,255,.11));
color: #fff;
text-rendering: optimizeLegibility;
text-shadow: 0 -1px 1px #222;
padding: 6px 10px 6px 10px;
@korenmiklos
korenmiklos / index.html
Last active January 3, 2016 03:29
Number of WTO members over time
<html>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/static/modules/gviz/1.0/chart.js"> {"dataSourceUrl":"//docs.google.com/spreadsheet/tq?key=0AhJS2rfBAT8JdE9HTndrVnNQa2s2b014Q1kzQ2JoMnc&transpose=0&headers=1&merge=COLS&range=B1%3AB160%2CD1%3AD160&gid=0&pub=1","options":{"displayAnnotations":true,"titleTextStyle":{"fontSize":16},"vAxes":[{"useFormatFromData":true,"title":"Left vertical axis title","minValue":null,"viewWindow":{"min":null,"max":null},"maxValue":null},{"useFormatFromData":true,"minValue":null,"viewWindow":{"min":null,"max":null},"maxValue":null}],"booleanRole":"certainty","title":"Chart title","wmode":"opaque","hAxis":{"useFormatFromData":true,"title":"Horizontal axis title","minValue":null,"viewWindow":{"min":null,"max":null},"maxValue":null},"width":960,"height":500},"state":{},"view":{},"isDefaultVisualization":true,"chartType":"AnnotatedTimeLine","chartName":"Chart 1"} </script>
</html>
lat lon
40.3381245 -74.653127
40.6581319 -73.9756447
50.9660479 10.3062993
50.7273062 12.4871539
52.521642 13.411007
54.4969325 13.5445994
47.7642521 15.8033294
47.689735 17.6000135
47.6037692 17.620454
from urllib2 import urlopen
from lxml.etree import parse
HOSTNAME = 'http://kozbeszerzes.ceu.hu'
otp = parse(urlopen(HOSTNAME + '/entity/t/10537914.xml'))
for tender in otp.xpath('//all_tenders_won/tender'):
print urlopen(HOSTNAME + tender.attrib['url'])
@korenmiklos
korenmiklos / statab
Last active August 29, 2015 14:08 — forked from pschumm/statab
#! /bin/bash
# Wrapper for "stata -b" which issues an informative error msg and appropriate
# (i.e., non-zero) return code
# The basic idea for this script (including grepping the log file to determine
# whether there was an error) was taken from a similar script posted by Brendan
# Halpin on his blog at http://teaching.sociology.ul.ie/bhalpin/wordpress/?p=122
args=$# # number of args
from skimage.feature import blob_log
from skimage.exposure import equalize_hist
from PIL import Image
from numpy import asarray
photo = Image.open("drone2.png").convert(mode="L")
ndarray = equalize_hist(asarray(photo))
blobs_log = blob_log(ndarray, min_sigma=1, max_sigma=50, num_sigma=20, threshold=.1)
print len(blobs_log)
@korenmiklos
korenmiklos / statab
Last active August 29, 2015 14:14 — forked from pschumm/statab
#! /bin/bash
# Wrapper for "stata -b" which issues an informative error msg and appropriate
# (i.e., non-zero) return code
# The basic idea for this script (including grepping the log file to determine
# whether there was an error) was taken from a similar script posted by Brendan
# Halpin on his blog at http://teaching.sociology.ul.ie/bhalpin/wordpress/?p=122
args=$# # number of args