Skip to content

Instantly share code, notes, and snippets.

View SuzanaK's full-sized avatar

Suzana K. SuzanaK

View GitHub Profile
@SuzanaK
SuzanaK / allinone_cl_download.py
Last active January 12, 2022 03:37
Using the ColourLovers API, these scripts will download all pattern image files (200 x 200 pixel, no repetition), palettes or colors that were created by a specific user. Usage: python cl_image_download.py USERNAME Until now, this script was only tested on a Linux system. After downloading, the image files will be in a directory called "images_U…
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib, urllib2, sys, os, time, json, codecs, requests, logging
import unicodecsv as csv
logging.basicConfig(level=logging.INFO)
CL_COLORS = 0
@SuzanaK
SuzanaK / bantu_languages.json
Created November 8, 2015 23:12
Bantu Language data in JSON format. Data sources: Wikipedia, Glottolog. Data Fields: speakers, glottolog code, name, Guthrie classification, geographic coordinates, Wikipedia page, countries where the language is native, Wikipedia categories, steps how far the language is descended from the original Bantu language.
[{"speakers": "24100", "code": "akwa1248", "name": "Akwa", "guthrie": "C.22", "long": 15.4623, "steps": 5, "lat": -0.39897, "iso": "akw", "wikipedia_page_ID": "35515400", "native": "", "categories": "Mboshi-Buja languages, Mboshi languages, Mboshi languages, Languages of the Republic of the Congo, Bantu language stubs", "spoken_in": "Republic_of_the_Congo"}, {"speakers": "40100", "code": "amba1263", "name": "Amba", "guthrie": "D.22, D.20B", "long": 30.0014, "steps": 6, "lat": 0.81206, "iso": "rwm", "wikipedia_page_ID": "27745809", "native": "Kwamba", "categories": "Boan languages, Biran languages, Languages without ISO 639-3 code but with Guthrie code, Languages of the Democratic Republic of the Congo, Languages of Uganda, Biran languages, Bantu language stubs", "spoken_in": "Democratic_Republic_of_the_Congo, Uganda"}, {"speakers": "widespread as L2 in DR Congo", "code": "aush1241", "name": "Aushi", "guthrie": "M.402", "long": 29.0168, "steps": 8, "lat": -11.6295, "iso": "auh", "wikipedia_page_ID": "35730752"
@SuzanaK
SuzanaK / pytest.md
Last active November 8, 2020 15:40 — forked from kwmiebach/pytest.md
pytest cheat sheet

Usage

(Create a symlink pytest for pytest)

pytest [options] [file_or_dir] [file_or_dir] ...

Help:

@SuzanaK
SuzanaK / NLTK code snippets
Created March 26, 2013 14:00
NLTK Code Snippets
# various NLTK code snippets
@SuzanaK
SuzanaK / README.md
Last active March 13, 2017 08:26
World map with languages of jw.org

Map of languages from jw.org (July 2014)

This visualisation does not contain all languages from jw.org (644 in July 2014) but only those where the Glottolog entry contains the geographical coordinates (587 languages).

Each circle contains a hyperlink to the corresponding publications on jw.org.

Map data from MBostock's TopoJSON, language data from Glottolog, languages from jw.org/en/publications, color palette from this ColourLovers palette.

You can scroll and move the map with the mouse.

@SuzanaK
SuzanaK / Python_Code_Snippets
Last active February 12, 2017 20:28
Python Snippets
# various Python code snippets
@SuzanaK
SuzanaK / bibelbücher_json
Last active December 30, 2015 21:29
JSON
{"1. Korinther": 46, "Habakuk": 35, "Epheser": 49, "2. Timotheus": 55, "Haggai": 37, "1. Samuel": 9, "Johannes": 43, "Jona": 32, "Daniel": 27, "Zephanja": 36, "1. Petrus": 60, "2. Chronika": 14, "Ruth": 8, "Judas": 65, "1. Mose": 1, "Esther": 17, "Jakobus": 59, "Maleachi": 39, "1. Johannes": 62, "Klagelieder": 25, "2. Mose": 2, "Kolosser": 51, "2. Korinther": 47, "1. Könige": 11, "Prediger": 21, "Micha": 33, "Philipper": 50, "Galater": 48, "Josua": 6, "Markus": 41, "Joel": 29, "Lukas": 42, "Hohes Lied": 22, "Jeremia": 24, "Hosea": 28, "Hiob": 18, "1. Timotheus": 54, "Psalm": 19, "2. Thessalonicher": 53, "Nehemia": 16, "5. Mose": 5, "Amos": 30, "Obadja": 31, "Apostelgeschichte": 44, "1. Chronika": 13, "Richter": 7, "4. Mose": 4, "Nahum": 34, "Matthäus": 40, "Römer": 45, "Sprüche": 20, "3. Johannes": 64, "Jesaja": 23, "Hesekiel": 26, "Hebräer": 58, "Sacharja": 38, "Titus": 56, "Philemon": 57, "Esra": 15, "Offenbarung": 66, "2. Könige": 12, "3. Mose": 3, "2. Johannes": 63, "2. Samuel": 10, "2. Petrus": 61, "1. T
@SuzanaK
SuzanaK / gnome_snippets
Last active December 15, 2015 10:28
Gnome Snippets
# disable automount of media like DVD, SD Card etc.
gsettings set org.gnome.desktop.media-handling automount false
@SuzanaK
SuzanaK / color_names.py
Created March 14, 2013 16:04
get closest colorname for an RGB color or a list of image files
import colorific
fixed_colors = {
"red" : (255, 0, 0),
'green' : (0, 255, 0),
'blue' : (0, 0, 255),
'orange' : (255, 127, 0),
'pink' : (255, 0, 127),
@SuzanaK
SuzanaK / html5_canvas_minimal_example.html
Created March 3, 2013 05:40
HTML5 Canvas Minimal Excample
<script>
var canvas = document.getElementById('mycanvas');
var ctx = canvas.getContext('2d');
ctx.beginPath();
ctx.moveTo(startX, startY);
ctx.lineCap = 'round';
ctx.lineWidth = 3;
var red = (((Math.random() * 64) + 128) >> 0);