Skip to content

Instantly share code, notes, and snippets.

@lambdamusic
lambdamusic / ontospy_example.py
Created May 16, 2017
ontospy example: extracting labels and descriptions
View ontospy_example.py
In [1]: import ontospy
In [2]: o = ontospy.Ontospy("foaf.rdf")
In [4]: c = o.classes[0]
In [5]: c
Out[5]: <Class *http://www.w3.org/2000/10/swap/pim/contact#Person*>
In [6]: c.bestLabel()
@lambdamusic
lambdamusic / mplayp.scm
Created Jan 6, 2017
Play pattern for midi instruments
View mplayp.scm
;;;;;;;;;;;;;;; On Beat ;;;;;;;;;;;;;;;;;;;;;
(define-macro (onbeat? b of t . f)
(if (null? f)
`(if (= (modulo beat ,of) (- ,b 1))
,t)
`(if (= (modulo beat ,of) (- ,b 1))
@lambdamusic
lambdamusic / keynote.scpt
Last active Jun 24, 2021
Apple Keynote: export presenter notes
View keynote.scpt
-- HOWTO:
-- after saving it, open with Script Editor (default) and run it
-- PREREQUISITES:
-- make sure your Keynote presentation is open in the background
-- AFTER EXPORT:
-- if you can't open the file due to encoding errors, open with Sublime (or another a text editor) and then "File / Save with encoding / UTF8"
tell application "Keynote"
@lambdamusic
lambdamusic / gist-backup.py
Last active Aug 24, 2019 — forked from fedir/gist-backup.py
Clone or update all user's gists #backup #github #gists #management
View gist-backup.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Forked from https://gist.github.com/fedir/5466075
Changes:
- allows to import Github gists into a local DASH database (https://kapeli.com/dash)
- gists are added to any existing snippet already in database
- filetypes are added, but support is very basic
@lambdamusic
lambdamusic / LICENSE.txt
Created Mar 1, 2016 — forked from anonymous/LICENSE.txt
Ontology documentation
View LICENSE.txt
The MIT License (MIT)
Copyright (c) 2016 OntoSPy project [http://ontospy.readthedocs.org/]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@lambdamusic
lambdamusic / index.html
Last active Jan 15, 2016
Automatically generated docs for extempore source code
View index.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:vs="http://www.w3.org/2003/06/sw-vocab-status/ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
@lambdamusic
lambdamusic / gist:eb4f4079642ff8e160a2
Created Jan 4, 2016 — forked from dvessel/gist:1478685
TextMate 2 .tm_properties
View gist:eb4f4079642ff8e160a2

This is all based on the [alpha release][1].

Properties

From the built-in help system:

For many settings TextMate will look for a .tm_properties file in the current folder and in any parent folders (up to the user’s home folder).

These are simple setting = value listings where the value is a format string in which other variables can be referenced.

@lambdamusic
lambdamusic / install-poppler-qt4-xpdf
Created Nov 20, 2015 — forked from cczona/install-poppler-qt4-xpdf
brew install -v poppler --with-qt4 --enable-xpdf-headers
View install-poppler-qt4-xpdf
$ brew install -v poppler --with-qt4 --enable-xpdf-headers
==> Downloading http://poppler.freedesktop.org/poppler-0.18.2.tar.gz
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
lambdamusic / extractAnnotations.py
Created Nov 20, 2015 — forked from stevepowell99/extractAnnotations.py
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
View extractAnnotations.py
#!/usr/bin/env python
# see http://socialdatablog.com/extract-pdf-annotations.html
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
lambdamusic / pypoppler_error.py
Created Nov 20, 2015
Error installing pypoppler
View pypoppler_error.py
>sudo pip install pypoppler
Collecting pypoppler
Downloading pypoppler-0.12.2.tar.gz
Complete output from command python setup.py egg_info:
Package pygobject-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `pygobject-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'pygobject-2.0' found
Package pycairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `pycairo.pc'