Skip to content

Instantly share code, notes, and snippets.

View gaurav's full-sized avatar

Gaurav Vaidya gaurav

View GitHub Profile
@gaurav
gaurav / field_summaries.2019-nov-4
Created November 4, 2019 23:33
List of fields used in PubMed Annual Baseline 2019
# '.' indicates XML nodes
# '/' indicates XML attributes
# '#' are XML values, but only for some fields
(PubmedArticleSet.PubmedArticle.MedlineCitation.Article.Abstract.AbstractText,34722040)
(PubmedArticleSet.PubmedArticle.MedlineCitation.Article.Abstract.AbstractText.DispFormula.math.mfrac.mn,2)
(PubmedArticleSet.PubmedArticle.MedlineCitation.Article.Abstract.AbstractText.DispFormula.math.mfrac.mrow.mi,7)
(PubmedArticleSet.PubmedArticle.MedlineCitation.Article.Abstract.AbstractText.DispFormula.math.mfrac.mrow.mo,6)
(PubmedArticleSet.PubmedArticle.MedlineCitation.Article.Abstract.AbstractText.DispFormula.math.mfrac.mrow.msub.mi,4)
(PubmedArticleSet.PubmedArticle.MedlineCitation.Article.Abstract.AbstractText.DispFormula.math.mfrac.msup.mi,1)
(PubmedArticleSet.PubmedArticle.MedlineCitation.Article.Abstract.AbstractText.DispFormula.math.mfrac.msup.mrow.mi,1)
@gaurav
gaurav / batman bares bear arms
Last active July 9, 2019 04:58
Batman Backlog
Jon Jon Wendt gives Gene Valgene his hooded cloak.
Gene Valgene: ...
Gene Valgene: [Batman voice] I'm the Batman now.
Jon Jon Wendt: Batman!
Gene Valgene: Batman.
Jon Jon Wendt: Batman! Batman! Batman!
Gene Valgene: BAAAAAAAAAT
Gene Valgene: MAAAAAAAAAAN
Jon Jon Wendt: That's the spirit!
Gene Valgene: [Batman voice] Hmm.
@gaurav
gaurav / gist:1475883
Created December 14, 2011 09:35
LaTeX to HTML on a Mac
1. Find your texbin directory. This is usually /usr/texbin, which is symlinked to wherever the actual directory is.
2. Add it to your PATH (i.e. `# export PATH=/usr/texbin:$PATH`)
3. Run the 'htlatex' command. This will convert your LaTeX file into an HTML document. Note that this really just a script around normal LaTeX, so you'll have to do the usual things (htlatex -> bibtex -> htlatex for citations, htlatex -> htlatex for references). I think: I had my LaTeX all PDF-LaTeXed and ready to go, so all the .bib/.toc/etc. files had already been created.
3.1. You might want to run 'htlatex file.tex "xhtml,fn-in"' if you have footnotes. Without that option, footnotes will be put into their own HTML file.
4. At this point, you have an HTML file. Check it and make sure it's good enough.
5. Open the HTML file in TextEdit. Oddly enough, Pages can't open HTML files, but TextEdit can. Go figure.
6. TextEdit can now save your file as an RTF or Doc file.
7. Success!
@gaurav
gaurav / .vimrc
Created December 5, 2018 15:48
My .vimrc
" Activate pathogen.
call pathogen#infect()
call pathogen#helptags()
" These are a few of my favourite settings.
syntax on
set background=dark
set hlsearch
set incsearch
set smartindent
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:ns1="http://www.w3.org/2002/07/owl#"
xmlns:ns2="http://www.essepuntato.it/2012/04/tvc/"
xmlns:ns3="http://rs.tdwg.org/dwc/terms/"
xmlns:ns4="http://vocab.phyloref.org/phyloref/testcase.owl#"
xmlns:ns5="http://purl.org/opentree/nexson#"
xmlns:ns6="http://purl.obolibrary.org/obo/"
xmlns:ns7="http://ontology.phyloref.org/phyloref.owl#"
xmlns:ns8="http://purl.org/spar/pso/"
[{
"@context": "https://www.phyloref.org/curation-tool/json/phyx.json",
"@type": "owl:Ontology",
"citation": "Example"
}]
@gaurav
gaurav / test.json
Last active December 13, 2017 15:30
Converting a blank node from JSON-LD (test.json) -> XML/RDF (test.xml) -> JSON-LD (test_back.json) and Turtle (test_back.ttl)
{
"@context": {
"obo": "http://purl.obolibrary.org/obo/",
"denotes": {
"@id": "obo:IAO_0000219",
"@type": "@id"
}
},
@gaurav
gaurav / .vimrc
Last active April 29, 2017 04:09
My .vimrc file
" Activate pathogen.
call pathogen#infect()
call pathogen#helptags()
" These are a few of my favourite settings.
syntax on
set background=dark
set hlsearch
set incsearch
set smartindent
#!/usr/bin/perl
# This is the program I wrote to crack this fun little cipher: http://keiththomsonbooks.com/cipher-02022012.html
# The clue clearly indicates that this is just a simple substitution cipher [1]; even better, it looks like ROT13 [2],
# except that you clearly don't move every letter along by exactly 13 places. So how many letters do you need to move
# it along by? There's only 26 letters in the English alphabet: let's try every possible value!
#
# [1] http://en.wikipedia.org/wiki/Substitution_cipher
# [2] http://en.wikipedia.org/wiki/ROT13
{
"result": [
{
"summary": {
"clazz": {
"Polypodiopsida": 1,
"Filicopsida": 1
},
"taxonomicStatus": "ACCEPTED",
"key": {