Skip to content

Instantly share code, notes, and snippets.

View c3333's full-sized avatar
💭
I may be slow to respond.

c3333

💭
I may be slow to respond.
View GitHub Profile
{
"globals": {
"Array": false,
"ArrayBuffer": false,
"Boolean": false,
"constructor": false,
"DataView": false,
"Date": false,
"decodeURI": false,
"decodeURIComponent": false,
@c3333
c3333 / asciidecodeerror.py
Created July 22, 2020 15:02 — forked from miraculixx/asciidecodeerror.py
Tired of Python's UnicodeDeocodeError, ascii codec can't decode? Here's how to fix it, once and for all.
# Python ascii codec can't decode and unicode mess
#
# check this out https://pythonhosted.org/kitchen/unicode-frustrations.html
# and this http://www.joelonsoftware.com/articles/Unicode.html
#
# The short of it is this
# 1. If you can, always set PYTHONIOENCODING=utf8 before you start your python programs.
# 2. If you can't or you can't ensure this, always use the following lambda _u to get unicode text
# whereever you convert to strings (str.format, str % etc.)
#
(ns appliedsciencestudio.covid19-clj-viz.repl
(:require [clojure.string :as string]
[hickory.core :as hick]
[hickory.select :as s]))
;;;; Scraping data
(def wiki-page
"We want this data, but it's only published as HTML."
(slurp "https://en.wikipedia.org/wiki/List_of_countries_by_hospital_beds"))
@jackrusher
jackrusher / iso-639-b.clj
Created November 5, 2014 11:52
code -> name table for iso-639-b in clojure
(def iso-639-b {"cai" "Central American Indian languages",
"mdr" "Mandar",
"chm" "Mari",
"kor" "Korean",
"kas" "Kashmiri",
"chi" "Chinese",
"nya" "Chichewa; Chewa; Nyanja",
"mdf" "Moksha",
"fan" "Fang",
"pam" "Pampanga; Kapampangan",