Skip to content

Instantly share code, notes, and snippets.

@jdittrich
jdittrich / technooptimistbooktitles
Created July 15, 2016 18:34
install npm install -g rmutt, run rmutt thistextinafi.le
Output: whatPart " " changePart ".\n";
changePart: "will " changes " " bigThing;
whatPart: AnswerQuestion " the " comeIntoBeing " of " adjectives " " changeAgent;
changes: "disrupt", "change", "revolutionize", "remake", "turn over";
bigThing:"the world", "our thinking", "IT", "everything", "education", "society", "humanity", "your brain";
AnswerQuestion: "Why", "How", "What happens when";
comeIntoBeing: "raise", "growth", "invention";
<!doctype html>
<html lang="us">
<head>
<!--
needs jquery.js, jqueryUI.js, jquerUI.css
and an image showing the revision slider bars like http://imgur.com/e7LNEDA
-->
<meta charset="utf-8">
<title>Slider Prototype</title>
<link href="jquery-ui.css" rel="stylesheet">
@jdittrich
jdittrich / grep hashtags to clipboard
Last active December 8, 2016 08:36
grep hashtags to clipboard. Needs xclip installed
xclip -out | grep '#\w\+' -o | xclip -selection clipboard
@jdittrich
jdittrich / TrumpRmutt
Last active January 30, 2017 17:51
install npm install -g rmutt, run rmutt thistextinafi.le
Output: Sentence "\n";
Sentence: SentenceIamGreat, SentenceBlaming, SentenceProduct, AdviceStupid, SentenceMake;
SentenceIamGreat: "It is a " HowItIs " "Thing ". " ParticleAfterMe;
AdviceStupid: "They say: " Advice "." ("I mean, like " areLike " programmers do?!",ParticleAfterOthers);
SentenceBlaming: (mainAntagonist=Antagonist) ParticleBefore ": The " mainAntagonist "is " evil (".","!"{1,6}) ParticleAfterMe;
@jdittrich
jdittrich / treecreator.js
Created June 18, 2017 10:11
Create Tree, JS version
//following adapted from https://stackoverflow.com/a/44185784/263398
var data2 = [{
name: "Children C1",
paths: [["A", "B", "C"],["A", "B"]]
}, {
name: "Children C2",
paths: [["A", "B", "C"]]
}, {
name: "Children C3",
paths: [["A", "B", "C"]]
@jdittrich
jdittrich / treecreator.py
Last active June 18, 2017 10:25
creates a tree. Each item (the things with "name") can be in multiple paths. Imagine it like a tree for a media collection with nested tags – every photo can have multiple (nested) tags
'''
The function call behaviour seems to be identical to the javascript version; I could not find any differences
However, the resulting tree is not identical, the javascript version "reuses" the paths,
whereas the python one seems to create a new path on every occasion.
'''
#following adapted from https://stackoverflow.com/a/44185784/263398 and ported to Python
from functools import reduce
@jdittrich
jdittrich / jsonToCsv.js
Last active August 25, 2017 08:48
JSON to CSV
//Data for testing it
var dataobject = {
rows:[
{Preis:"100",Geraet:"Android Phone"},
{Preis:"600",Geraet:"iPad"},
{Preis:"1000",Geraet:"Thinkpad"}
]
};
//get all column names. Use the first object in rows for that.
@jdittrich
jdittrich / gist:3f589ab7d2cd360bb31ae97f990d9371
Created January 9, 2018 22:23
marks for improving english text
var s = document.createElement("script");
s.type = "text/javascript";
s.src = "https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.0/mark.js";
$("head").append(s);
var markinstance = new Mark(document.querySelectorAll("p,ul,li,quote, cite"));//all common elements pandoc puts out.
markinstance.markRegExp(/(\.|;|—|\:)/gim, {className:"strongHighlight"}); //sentence lenght
markinstance.markRegExp(/(was |will |do |is |of )/gim); //simple passive verbs
markinstance.markRegExp(/( is that)/gim); //no "is that"
@jdittrich
jdittrich / Bruno Latour – Eine Neue Soziologie für eine Neue Gesellschaft
Last active March 5, 2018 12:25
Bruno Latour "Eine Neue Soziologie für eine Neue Gesellschaft" – Themenzusammenfassung und Seitenangaben
# THEMEN
## ANT und lokal/global
* 95,105 ANT ist nicht lokaler oder weniger Abstrakt als andere Soziologische Theorien (auch: 392, 352)
* Akteur/Netzwerk entspricht Lokales/verbundenes
* 315 Abstraktes soll werden zu: "Wo", "Wann", "Womit"
* 352 Nichts ist nur lokal oder nur global
* 392 Globales und Lokales existieren gleichzeitig, nicht entweder oder
* 407 Je mehr verknüpfungen, desto besser

Law, John. 2004. After Method: Mess in Social Science Research. London ; New York: Routledge.

page/comment

3 is "knowing" the metaphor we need?

4 standard research methods are not generally wrong

5 to have rules seems natural