Skip to content

Instantly share code, notes, and snippets.

@MoritzStefaner
MoritzStefaner / .block
Last active Jan 20, 2020
Force-based label placement
View .block
license: apache-2.0
View MapOptimizer.as
package eu.stefaner.researchdensity {
import eu.stefaner.flareextensions.Helpers;
import flare.animate.Transitioner;
import flare.util.Property;
import flare.vis.Visualization;
import flare.vis.data.Data;
import flare.vis.data.DataList;
import flare.vis.data.NodeSprite;
@MoritzStefaner
MoritzStefaner / gist:3423911
Created Aug 22, 2012
Sample class for rendering a gephi layout with Java/processing
View gist:3423911
import java.io.File;
import java.io.FileNotFoundException;
import java.net.URISyntaxException;
import org.gephi.data.attributes.api.AttributeController;
import org.gephi.data.attributes.api.AttributeModel;
import org.gephi.filters.api.FilterController;
import org.gephi.graph.api.DirectedGraph;
import org.gephi.graph.api.Edge;
@MoritzStefaner
MoritzStefaner / citysearch.py
Created Dec 6, 2012
Search where people are moving in Germany
View citysearch.py
# coding: utf-8
# requires: pattern http://www.clips.ua.ac.be/pages/pattern
from pattern.web import *
import csv
import sys
# yeah I know
reload(sys)
sys.setdefaultencoding("utf-8")
View gist:9793619
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours.
{It's|It is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as you did, the {internet|net|web} will be {much more|a lot
more} useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting.
{Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch}
your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or
{newsletter|e-newsletter} service. Do {you have|you've} any?
{Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe.
@MoritzStefaner
MoritzStefaner / _.md
Created May 17, 2014
Path information from Illustrator
View _.md
View gist:c279dccce26cb2098de6
{a, ul, ol, li, div, img, h2, h3, form, input, button} = React.DOM
Component = (o) -> React.createFactory React.createClass o
app = undefined
$ ->
app = React.render App({}), $("#app")[0]
App = Component(
getInitialState: ->
{
@MoritzStefaner
MoritzStefaner / _guess.py
Last active Sep 10, 2015
(Roughly) gender guessing ars submissions. This is based on the first names of ars electronica submissions up to 2008. Gender guess through https://pypi.python.org/pypi/gender-detector/0.0.4. Results: ({'male': 14847, 'unknown': 10772, 'female': 5281}) estimated 26.2% women
View _guess.py
# requires https://pypi.python.org/pypi/gender-detector/0.0.4
from gender_detector import GenderDetector
from collections import defaultdict, Counter
f = open("firstnames.txt", "r")
detector = GenderDetector('us')
count = 0
@MoritzStefaner
MoritzStefaner / frustrations.tsv
Created Mar 17, 2017
Text answers from the dataviz survey 2017 by Elijah Meeks et al.
View frustrations.tsv
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
""
Comp
""
Getting data into the right format/place to do analysis & vis
Poor data governance
Antiquated data architecture
Try to be data driven- but our data efforts aren't consistent
firewalls preventing the movement of data and marketing professionals with no analytical knowledge
""
The lack of time to do original data journalism: lack of proper training and opportunity to expand skills into coding.
View vs-code-pipenv.md

{ "python.venvPath": "${workspaceFolder}/.venv/bin/python", "python.pythonPath": ".venv/bin/python", }