Skip to content

Instantly share code, notes, and snippets.

lambdamusic /
Created October 14, 2015 18:31 — forked from jprante/
JSON-LD in Elasticsearch
curl -XDELETE 'localhost:9200/jsonld'
curl -XPOST 'localhost:9200/jsonld'
curl -XPUT 'localhost:9200/jsonld/doc/1' -d '
"dc": "",
lambdamusic / index.html
Created October 15, 2015 19:17
ttest output for ontospy
<!DOCTYPE html>
<html xmlns="" xml:lang="en" lang="en">
lambdamusic /
Created November 5, 2015 15:50
Find all letters in string (regex)
import re
st = ".srep05794"
res = " ".join(re.findall("[a-zA-Z]+", st))
lambdamusic /
Created November 20, 2015 16:51 — forked from stevepowell99/
Extracts annotations and highlighted passages in all .pdf files in a folder recursively and outputs them as text files with the same name and modification date
#!/usr/bin/env python
# see
myxkfolder="/home/steve/xk/" #you need to set this to where you want your to-dos to appear
import poppler, os.path, os, time, datetime
for root, dirs, files in os.walk('./'):
for lpath in files:
lambdamusic / install-poppler-qt4-xpdf
Created November 20, 2015 18:01 — forked from cczona/install-poppler-qt4-xpdf
brew install -v poppler --with-qt4 --enable-xpdf-headers
$ brew install -v poppler --with-qt4 --enable-xpdf-headers
==> Downloading
File already downloaded in /Users/cczona/Library/Caches/Homebrew
/usr/bin/tar xf /Users/cczona/Library/Caches/Homebrew/poppler-0.18.2.tar.gz
Package QtCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `QtCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'QtCore' found
Package QtGui was not found in the pkg-config search path.
Perhaps you should add the directory containing `QtGui.pc'
lambdamusic /
Last active December 12, 2015 06:39
Python: Shell Script With Options
import sys
import time
import math
import optparse
__version__ = "0.1"
__copyright__ = "CopyRight (C) 2013 by Michele Pasin"
__license__ = "MIT"
lambdamusic / Snipplr-26506.txt
Created February 7, 2013 21:24
Altering Database Tables: Add More Columns :
mysql> ALTER TABLE Employee ADD (EMail VARCHAR(25), ICQ VARCHAR(15));
lambdamusic /
Created February 7, 2013 21:25
Python: Creating directories programmatically
import sys
import os
def ensure_dir(f):
d = os.path.dirname(f)
if not os.path.exists(d):
lambdamusic /
Created February 7, 2013 21:25
Django: Django | Testing Django applications
from django.test.client import Client
c = Client()
response =\'/login/\', {\'username\': \'john\', \'password\': \'smith\'})
# 200
response = c.get(\'/customer/details/\')
# \'<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 ...\'
lambdamusic /
Created February 7, 2013 21:24
Python: 'Dictionary Comprehensions'
emails = {'Dick': '', 'Jane': '', 'Stou': ''}
email_at_dotcom = dict( [name, '.com' in email] for name, email in emails.iteritems() )
# email_at_dotcom now is {'Dick': True, 'Jane': True, 'Stou': False}