Skip to content

Instantly share code, notes, and snippets.

View dpriskorn's full-sized avatar
💭
Looking for work as a developer 🚀

Nizo Priskorn dpriskorn

💭
Looking for work as a developer 🚀
View GitHub Profile
@mcobzarenco
mcobzarenco / wikidata.py
Created July 7, 2015 17:29
Parse wikidata dump in Python
#!/usr/bin/env python
from __future__ import print_function, division
import argparse
import json
import sys
from gzip import GzipFile
def concat_claims(claims):
for rel_id, rel_claims in claims.iteritems():
@tasdikrahman
tasdikrahman / python_tests_dir_structure.md
Last active May 9, 2024 19:46
Typical Directory structure for python tests

A Typical directory structure for running tests using unittest

Ref : stackoverflow

The best solution in my opinion is to use the unittest [command line interface][1] which will add the directory to the sys.path so you don't have to (done in the TestLoader class).

For example for a directory structure like this:

new_project

├── antigravity.py

@sloanlance
sloanlance / jq_tsv_conversion.md
Last active April 12, 2024 04:33
jq: JSONL → TSV conversion

jq: JSONL → TSV conversion

What is TSV?

TSV means "tab-separated values". I prefer this format over CSV ("comma-separated values") because it doesn't require as much quoting. Many programs that can use CSV formatted data can also use TSV, although they may need to be explicitly told of the different format if it's not detected automatically.

However, in any of the jq scripts below, "@tsv" can usually be replaced with "@csv" to get CSV output instead.

@pvik
pvik / smartparens-cheatsheet.md
Last active March 17, 2024 03:29
A Cheatsheet for Emacs Smarparens example configuration

An animated cheatsheet for smartparens using the example configuration specified here by the smartparens author. Inspired by this tutorial for paredit.

Traversal

C-M-f sp-forward-sexp
C-M-b sp-backward-sexp
@chrisjsimpson
chrisjsimpson / dms2dec.py
Created April 1, 2019 12:17 — forked from jeteon/dms2dec.py
Convert coordinates in DMS notation to decimal in Python.
#!/env/python
# coding=utf8
"""
Converting Degrees, Minutes, Seconds formatted coordinate strings to decimal.
Formula:
DEC = (DEG + (MIN * 1/60) + (SEC * 1/60 * 1/60))
Assumes S/W are negative.
@salgo60
salgo60 / FindDeletedWD.py
Last active October 4, 2021 19:08
Finds deleted WD objects referenced from Europeana
import json
import requests
urlbase = 'http://data.europeana.eu/'
uribase = 'agent/base/'
import sys
print (sys.getdefaultencoding())
def checkWDobject(Qnumber,currUri):
@brianwitte
brianwitte / doom.txt
Created July 30, 2020 05:55 — forked from hjertnes/doom.txt
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
@salgo60
salgo60 / GetWordsInSAOB.py
Last active January 5, 2021 13:09
Extracts words in SAOB to file
# based on https://github.com/Torbacka/wordlist/blob/master/client.py
import requests
from bs4 import BeautifulSoup
data = {
'action': 'myprefix_scrollist',
'unik': '0',
'dir': 'ned',
'dict': 'saob'
}
@salgo60
salgo60 / README.md
Last active March 20, 2021 11:37 — forked from VladimirAlexiev/README.md
Google Sheets to Wikidata
[
{
"Eionet bathingWaterIdentifier":"SE0441273000000001",
"name":{
"sv":{
"language":"sv",
"value":"Vesljungasjön, badplats"
},
"de":{
"language":"de",