Skip to content

Instantly share code, notes, and snippets.

@rdhyee
rdhyee / bug_report.ipynb
Last active July 19, 2016 22:22
A demonstration of a bug in pyzotero reported at https://github.com/urschrei/pyzotero/issues/52
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
We can't make this file beautiful and searchable because it's too large.
gitb_id gitb_name title language downloads text_files
3881 1342 Pride-and-Prejudice_1342 Pride and Prejudice en 39054 [1342.txt]
2258 11 Alice-s-Adventures-in-Wonderland_11 Alice's Adventures in Wonderland en 27037 [11.txt]
19931 27827 The-Kama-Sutra-of-Vatsyayana--13-Translated-From-the-Sanscrit-in-Seven-Parts-With-Preface-Int__27827 "The Kama Sutra of Vatsyayana
Translated From the Sanscrit in Seven Parts With Preface, Introduction and Concluding Remarks" en 19610 [27827-8.txt, 27827.txt]
46905 76 Adventures-of-Huckleberry-Finn_76 Adventures of Huckleberry Finn en 17799 [76.txt]
46682 74 The-Adventures-of-Tom-Sawyer_74 The Adventures of Tom Sawyer en 17767 [74.txt]
10680 1952 The-Yellow-Wallpaper_1952 The Yellow Wallpaper en 16170 [1952.txt]
36835 4300 Ulysses_4300 Ulysses en 14898 [4300-8.txt, 4300.txt]
8425 174 The-Picture-of-Dorian-Gray_174 The Picture of Dorian Gray en 13726 [174.txt]
We can't make this file beautiful and searchable because it's too large.
31854 ---------------------------------------------------------------------------------------------__31854
37721 ------------------------------------------------------------------------------------------_37721
42510 -------------------------------------------------------------------------------_42510
4100 ----------------------------------------------------------------------------_4100
31434 ------------------------------------------------------------13--------------------------_31434
34182 ------------------------------------------------------------_34182
32179 ---------------------------------------------------------_32179
32386 ---------------------------------------------------------_32386
31669 -------------------------------------------------------_31669
41868 -------------------------------------------------------_41868
@rdhyee
rdhyee / generating_epub_via_htmlbook.md
Created April 23, 2015 22:48
Notes on how I generated EPUB from an AsciiDoc book using asciidoctor-htmlbook and HTMLBook

Starting point:

@rdhyee
rdhyee / unicode_csv.py
Created March 25, 2015 22:49
A little module I wrote a while back to work with unicode and CSV. (I'm hoping that I won't need it because I can use https://github.com/jdunck/python-unicodecsv instead.
# -*- coding: utf-8 -*-
"""
unicode_csv.py -- wrap the csv module to allow for the handling of CSV files with unicode
"""
#http://docs.python.org/library/csv.html#examples
import csv
import codecs
import difflib
@rdhyee
rdhyee / predicates_in_gutenberg.csv
Created March 20, 2015 23:04
Number of Gutenberg records: 48538 (2015.03.20)
http://www.w3.org/1999/02/22-rdf-syntax-ns#value 1006673
http://purl.org/dc/dcam/memberOf 957977
http://www.w3.org/1999/02/22-rdf-syntax-ns#type 815319
http://purl.org/dc/terms/format 773179
http://purl.org/dc/terms/modified 654523
http://purl.org/dc/terms/hasFormat 654523
http://purl.org/dc/terms/isFormatOf 654523
http://purl.org/dc/terms/extent 654523
http://purl.org/dc/terms/subject 118488
http://www.gutenberg.org/2009/pgterms/alias 64787
@rdhyee
rdhyee / pg2701.rdf
Created February 18, 2015 23:52
The Project Gutenberg RDF file for Moby Dick http://www.gutenberg.org/ebooks/2701
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xml:base="http://www.gutenberg.org/"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:pgterms="http://www.gutenberg.org/2009/pgterms/"
xmlns:cc="http://web.resource.org/cc/"
xmlns:dcam="http://purl.org/dc/dcam/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
>
<cc:Work rdf:about="">
@rdhyee
rdhyee / github_deploy_key.py
Created February 13, 2015 03:51
first pass at an Ansible module to create a deploy key....work in progress
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Raymond Yee <raymond.yee@gmail.com>
import os
import json
import base64
from StringIO import StringIO
@rdhyee
rdhyee / docker_alias.sh
Created February 6, 2015 21:48
docker related alias for working with boot2docker or docker in general (docker_rm, docker_rmi)
# docker aliases
alias docker_rmi='docker images -a -q -f "dangling=true" --no-trunc | xargs docker rmi'
alias docker_rm='docker ps -a -q --no-trunc | xargs docker rm'
alias docker_time='boot2docker ssh sudo ntpclient -s -h pool.ntp.org'