Skip to content

Instantly share code, notes, and snippets.

View nikopartanen's full-sized avatar
🐱

Niko Partanen nikopartanen

🐱
View GitHub Profile
@agricolamz
agricolamz / facetization_mapview_lingtypology.R
Last active June 13, 2018 11:03
facetization mapview + lingtypology
library(lingtypology); library(tidyverse)
df <- read_csv("knowledge_russian_in_Daghestan.csv")
# old way -----------------------------------------------------------------
df %>%
filter(year_of_birth_dec == 1910) ->
v_1910
map.feature(v_1910$Language,
features = v_1910$lang_knowledge,
latitude = v_1910$Lat,
from gensim.models import KeyedVectors
# Load gensim word2vec
w2v_path = '<Gensim File Path>'
w2v = KeyedVectors.load_word2vec_format(w2v_path)
import io
# Vector file, `\t` seperated the vectors and `\n` seperate the words
"""
@etrushkin
etrushkin / cyrillic2latin_file_renamer.py
Last active May 17, 2018 23:40 — forked from ramanqul/cyrillic2latin_file_renamer.py
Cyrillic to Latin File Changer
#!/usr/bin/python
# -*- coding: utf-8 -*-
# http://stackoverflow.com/questions/5574702/how-to-print-to-stderr-in-python
from __future__ import print_function
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
import errno
@bergeycm
bergeycm / plot-kitty.R
Created August 29, 2014 17:29
R function to grab a random picture of a cat and a random quote from Dune and plot them together.
plot.kitty = function () {
library(jpeg)
temp.cat = tempfile()
download.file("http://thecatapi.com/api/images/get?format=src&type=jpg",
destfile=temp.cat)
kitty = readJPEG(temp.cat)
@slowkow
slowkow / NeedlemanWunsch.png
Last active July 26, 2024 03:22
Plot the score matrix from a Needleman-Wunsch pairwise sequence alignment
NeedlemanWunsch.png