Skip to content

Instantly share code, notes, and snippets.

# -*- coding: utf-8 -*-
import pywikibot
import json
site = pywikibot.Site("wikidata", "wikidata")
repo = site.data_repository()
def set_active(politican_item_id):
item = pywikibot.ItemPage(repo, politican_item_id)
claims = item.get()['claims']['P39']
@k-nut
k-nut / knowledge.md
Last active July 13, 2020 12:40
Knowledge I have gained throughout the years

vim

  • <n>G to jump to nth row
  • ctrl+o to jump to last curor position
  • ctrl+n to highlight word, again to jump to next one, ctrl-x to skip one ctrl-p to go back-
    • with plugin: c to change the selection
  • q: to get a window of all last commands <CR> to execute them
  • J to move the following line to the end of this line
  • <leader>s to substitute word under cursor
  • "dd deleted line into register
@k-nut
k-nut / booklist.md
Created April 14, 2016 19:18
Proposed books at first Programmers' Book Club Berlin

Proposed books at first Programmers' Book Club Berlin

  • The Phoenix Project: A Novel About IT, DevOps, and Helping Your Business Win
  • Geek Sublime: The Beauty of Code, the Code of Beauty
  • Release It! Design and Deploy Production-Ready Software
  • Domain-Driven Design: Tackling Complexity in the Heart of Software
  • How to Stop Sucking and Be Awesome Instead
  • The Pragmatic Programmer: From Journeyman to Master
  • The Healthy Programmer - Get Fit, Feel Better, and Keep Coding
  • The Lean Startup
  • SQL Performance explained
@k-nut
k-nut / blablakarte.de.md
Last active August 29, 2015 14:13
Monothematische Karten
bootbox.prompt({
title: "What is your real name?",
value: "makeusabrew",
callback: function(result) {
if (result === null) {
Example.show("Prompt dismissed");
} else {
Example.show("Hi <b>"+result+"</b>");
}
}

Keybase proof

I hereby claim:

  • I am k-nut on github.
  • I am knut (https://keybase.io/knut) on keybase.
  • I have a public key whose fingerprint is 7F58 FF6C 32A2 4C6C 6A8B 7BC7 7341 4264 131E E8A2

To claim this, I am signing this object:

@k-nut
k-nut / main.py
Created September 17, 2014 07:03
Flask minimal testcase
from flask import Flask
app = Flask(__name__)
@app.route('/')
def main():
return notExistingFunction()
{
"bot_id": "singaporeFinancialOrganisations",
"title": "Bot for opencorporates mission 562",
"description": "Financial Institutions and Relevant Organisations in Singapore ",
"language": "python",
"data_type": "primary data",
"identifying_fields": [
"Company"
],
"files": [
from datetime import date
import json
from datetime import date
from bs4 import BeautifulSoup
import requests
import turbotlib
def extractData(link):
source_url = link
@k-nut
k-nut / freakshow.js
Created May 19, 2014 20:22
FreakshowActivity
$.getJSON( "./fs132-denk-nicht-in-layern-denk-in-schichten.json", function( data ) {
var items = [];
console.log(data.statistics.tracks);
$.each( data.statistics.tracks, function( key, val ) {
var total = 0;
$.each(val.activity, function(key, val){
total += val[1] - val[0];
});
console.log(val.identifier + ': ' + Math.round(total/60) + ' min');
});