Skip to content

Instantly share code, notes, and snippets.

View gaurav's full-sized avatar

Gaurav Vaidya gaurav

View GitHub Profile
@gaurav
gaurav / commonswiki-20140227-article-categories.ttl
Last active August 29, 2015 13:57
Information from a small dump from the Wikimedia Commons as extracted by two DBpedia Extractors, ArticleCategoriesExtractor and InfoboxExtractor.
# started 2014-03-24T23:34:27Z
<http://commons.dbpedia.org/resource/File:Cramer&Stoll-uitlandsche_kapellen_vol._1-_-Frontispiece_2.jpg> <http://purl.org/dc/terms/subject> <http://commons.dbpedia.org/resource/Category:Cramer_and_Stoll:De_uitlandsche_kapellen> .
<http://commons.dbpedia.org/resource/File:Cemophora_coccineaHolbrookV3P30A.jpg> <http://purl.org/dc/terms/subject> <http://commons.dbpedia.org/resource/Category:Cemophora_coccinea> .
<http://commons.dbpedia.org/resource/File:Cemophora_coccineaHolbrookV3P30A.jpg> <http://purl.org/dc/terms/subject> <http://commons.dbpedia.org/resource/Category:North_American_Herpetology_(Holbrook)> .
<http://commons.dbpedia.org/resource/File:Cemophora_coccineaHolbrookV3P30A.jpg> <http://purl.org/dc/terms/subject> <http://commons.dbpedia.org/resource/Category:PD_art_uploaded_by_Patrick_Coin> .
<http://commons.dbpedia.org/resource/File:Dryandra_armata_(Curtis's_Botanical_Magazine_Plate_3236).jpg> <http://purl.org/dc/terms/subject> <http://commons.dbpedia.org/resource/Catego
@gaurav
gaurav / usage.pl
Created February 15, 2014 03:19
Demonstrating the logical defined-or operator
#!/usr/bin/perl
use strict;
use warnings;
my $NewUsage = 150;
my %Usage = ();
foreach my $mac ('ABC', 'DEF', 'ABC', 'DEF', 'GHI') {
$Usage{$mac} = $Usage{$mac} // 0;
{
"result": [
{
"summary": {
"clazz": {
"Polypodiopsida": 1,
"Filicopsida": 1
},
"taxonomicStatus": "ACCEPTED",
"key": {
@gaurav
gaurav / citeulike-by-selection
Created June 5, 2013 04:42
Bookmarklet to add selection (i.e. DOI or URL) to CiteULike
javascript:(function(){var t=window.getSelection?window.getSelection().toString():document.selection.createRange().text; window.location="http://www.citeulike.org/posturl?url="+t;})()
@gaurav
gaurav / delimit2rdf.pl
Created October 2, 2012 08:03
A file to split a DwC-A file into triples
#!/usr/bin/perl -w
use strict;
use warnings;
use v5.10.0;
=head1 NAME
delimit2rdf.pl -- Delimited file to RDF
@gaurav
gaurav / flickr_species_badge.html
Created April 5, 2012 06:07
A species badge (for Panthera tigris) from Flickr
<script>
var species_name = "Panthera tigris"; // Tweak this
var number_of_images = 5; // Tweak this
</script>
<!-- Start of Flickr Badge -->
<style type="text/css">
#flickr_badge_source_txt {padding:0; font: 11px Arial, Helvetica, Sans serif; color:#666666;}
#flickr_badge_icon {display:block !important; margin:0 !important; border: 1px solid rgb(0, 0, 0) !important;}
#flickr_icon_td {padding:0 5px 0 0 !important;}
@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 / iucn.json
Created November 22, 2011 03:38
A bigger GeoJSON file
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Atom Zombie Smasher
Commander: Gaurav
Start date: November 19, 2011
Zeppelin: One Moon Zeppelin
Codename: OperationWakingHeron528
----------------------------------
JANUARY 1961: AURORA AUSTRALIS.
Shorter daytime.
@gaurav
gaurav / unicode.json
Created November 17, 2011 22:51
A GeoJSON file containing Unicode text.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.