Skip to content

Instantly share code, notes, and snippets.

View diogo-almeida's full-sized avatar

Diogo Almeida diogo-almeida

View GitHub Profile
@diogo-almeida
diogo-almeida / Example: critical_sentences.txt
Last active August 29, 2015 13:59
Split stimulus master list into individual lists based on first column
1 1 E We don’t use a telephone in our house anymore.
2 1 EK We don’t use a 전화기 in our house anymore.
3 1 K 우리집에선 이제 전화기 안 써.
4 1 KE 우리집에선 이제 telephone 안 써.
2 2 E He doesn’t like drinking tea at all.
3 2 EK He doesn’t like drinking 차 at all.
4 2 K 걘 차 마시는 거 하나도 안 좋아해.
1 2 KE 갠 tea 마시는 거 하나도 안 좋아해.
3 3 E She practices baseball every Tuesday.
4 3 EK She practices 야구 every Tuesday.
@diogo-almeida
diogo-almeida / docx2pdf
Last active July 23, 2023 22:25
Batch .docx conversion to .pdf using LibreOffice from the command line
# Path of LibreOffice installation
cd /Applications/LibreOffice.app/Contents/MacOS
# General command
./soffice --headless --convert-to <extension> <path+file>
# Automatically convert all .odt files to pdf
./soffice --headless --convert-to pdf ~/Downloads/*.odt
# To specify an output folder you can add the --outdir option
@diogo-almeida
diogo-almeida / using_skimnotes
Created February 12, 2014 16:33
Extract annotation out of Skim-annotated files (Skim is a Mac OS X only application for viewing and annotating pdfs).
# In order to be able to use the Skim command line utilities, you might have to need to copy them to your /usr/bin/ folder
sudo cp -p /Applications/Skim.app/Contents/SharedSupport/skimpdf /usr/bin/
sudo cp -p /Applications/Skim.app/Contents/SharedSupport/skimnotes /usr/bin/
sudo cp -p /Applications/Skim.app/Contents/SharedSupport/displayline /usr/bin/
# Use skimnotes to extract annotations:
skimnotes get Almeida2013.pdf Almeida2013.txt # extract annotation into text format
skimnotes get Almeida2013.pdf Almeida2013.skim # extract annotation into skim format
@diogo-almeida
diogo-almeida / extract_from_bibtex.awk
Created February 12, 2014 12:17
Easy extraction of bibtex entries in databases created by JabRef
# The trick: Set Record Separator to nil, and Field Separator to newline.
# This capitalizes on the structure of how JabRef formats the database, where each entry is separated by a newline.
# The following command prints the first line of the record, which is the bibtex type field and the entry key.
BEGIN{RS=""; FS="\n"}
{print $1}
# Other possible options:
# {print $(NF) # This prints the last line (should be the closing curly bracket)
@diogo-almeida
diogo-almeida / 0_reuse_code.js
Created January 10, 2014 22:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console