Skip to content

Instantly share code, notes, and snippets.

View jcuenod's full-sized avatar

James Cuénod jcuenod

View GitHub Profile

Document

In storing our annotations, we will need some kind of document outline.

  1. Minimally, we need a URI.
  2. Annotation sets tagged to particular corpora. This could be stored elsewhere, though.
  3. If we differentiate between "word" level and "unit" level annotations, we need to note that somewhere (again, maybe elsewhere).
  4. We need the actual annotation set
#!/bin/bash
# usage: ./search_libreoffice_documents.sh search_term
# If you want to search types other than `.odt`, edit this line
find . -type f -name "*.odt" | while read i ; do
[ "$1" ] || { echo "You forgot search string!" ; exit 1 ; }
unzip -ca "$i" 2>/dev/null | grep -aoi -E ".{0,10}$*.{0,10}"
if [ $? -eq 0 ] ; then
echo "$i: $?" | nl
@jcuenod
jcuenod / describe_all_tables
Created May 23, 2019 23:03
Dump mysql table descriptions of all tables in db to tab separated file
mysql -h 127.0.0.1 -P 3306 db_name -u foo --password=bar -e "SELECT TABLE_NAME, COLUMN_NAME, COLUMN_TYPE FROM information_schema.columns WHERE table_schema = 'db_name';" > out.tsv
@jcuenod
jcuenod / unpromote-twitter.user.js
Last active September 25, 2018 18:12
Remove promotions from twitter
// ==UserScript==
// @name Unpromote Twitter
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author James Cuénod
// @match https://twitter.com/home
// @grant none
// ==/UserScript==
@jcuenod
jcuenod / jamapi_note
Created October 26, 2016 22:13
jamapi stuff to fetch from bookfinder
https://www.jamapi.xyz/
http://www.bookfinder.com/search/?author=&title=&lang=en&isbn=0800638581&submitBtn=Search&new=1&used=1&ebooks=1
{
"title": "title",
"prices": [{"elem": "table.results-table-Logo td:last-child", "price": "text"}],
"sellers": [{"elem": "table.results-table-Logo td:nth-child(2) a img", "seller": "alt"}],
"2nd hand": [{"elem": "table.results-table-Logo td:nth-child(2) .results-explanatory-text-Logo:first-child", "seller": "text"}]
}
# Showing "Hebrew (Biblical, SIL phonetic)" as option in Gnome
# (layout exists in /usr/share/X11/xkb/symbols/il)
# Credit: http://askubuntu.com/questions/567814/enabling-sil-phonetic-biblical-hebrew-keyboard
gsettings set org.gnome.desktop.input-sources show-all-sources true
@jcuenod
jcuenod / semantic-2.1.8-silentValidation.js
Last active January 27, 2016 05:09
semantic-ui with support for silent form validation
/*!
* # Semantic UI 2.1.7 - Patched to do "is valid" silently (I could have sworn it was version 2.1.8 though)
* http://github.com/semantic-org/semantic-ui/
*
*
* Copyright 2015 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
ul {
list-style-type: none;
}
li {
display: inline-block;
}
input[type="checkbox"][id^="cb"] {
display: none;