Skip to content

Instantly share code, notes, and snippets.

@hubgit
hubgit / journal-feeds.csv
Created April 24, 2013 15:50
All the journal feeds in JournalTOCs
We can't make this file beautiful and searchable because it's too large.
publisher id,feed id,feed url,journal url,journal title
1050,28092,http://journals.uran.ua/eejet/gateway/plugin/WebFeedGatewayPlugin/rss,http://journals.uran.ua/eejet/,"Східно-Європейський журнал передових технологій : Eastern-European Journal of Enterprise Technologies"
1761,25094,http://feeds.feedburner.com/Archeomatica?format=xml,http://www.archeomatica.it/,Archeomatica
1739,24698,http://cerealchemistry.aaccnet.org/action/showFeed?ui=0&mi=3b39wk&ai=rs&jc=cchem&type=etoc&feed=rss,http://cerealchemistry.aaccnet.org/journal/cchem,"Cereal Chemistry"
1721,27750,http://journals.aau.dk/index.php/MIPO/gateway/plugin/WebFeedGatewayPlugin/rss,http://journals.aau.dk/index.php/MIPO,"Musikterapi i Psykiatrien Online"
1549,26667,http://ojs.statsbiblioteket.dk/index.php/bras/gateway/plugin/WebFeedGatewayPlugin/rss,http://ojs.statsbiblioteket.dk/index.php/bras,"Brasiliana - Journal for Brazilian Studies"
@hubgit
hubgit / article-meta.txt
Last active October 26, 2025 04:35
HTML meta tags used by journal articles. ISSNs from http://www.crossref.org/titleList/ 5 DOIs of articles published in 2012 from http://search.labs.crossref.org/dois?year=2012&type=Journal+Article&rows=5&q={ISSN} 19,868 ISSNs, 96,751 files. Numbers given are number of ISSNs with that meta[name][content] (i.e. maximum is 19,868). Caveat: some of …
[citation_title] => 10193
[citation_journal_title] => 10171
[citation_volume] => 9878
[citation_pdf_url] => 9671
[citation_issue] => 9560
[citation_issn] => 9483
[citation_firstpage] => 9376
[citation_doi] => 9324
[robots] => 8939
[citation_abstract_html_url] => 8906
@hubgit
hubgit / twitter-oauth-pecl.php
Created May 20, 2010 17:58
Command line Twitter OAuth authentication in PHP
<?php
// Register an app: http://dev.twitter.com/apps
define('CONSUMER_KEY', 'YOUR CONSUMER KEY');
define('CONSUMER_SECRET', 'YOUR CONSUMER SECRET');
define('TWITTER_TOKEN', '');
define('TWITTER_TOKEN_SECRET', '');
$oauth = new OAuth(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_URI);
@hubgit
hubgit / README.md
Last active September 28, 2025 16:30
Remove metadata from a PDF file, using exiftool and qpdf. Note that embedded objects may still contain metadata.

Anonymising PDFs

PDF metadata

Metadata in PDF files can be stored in at least two places:

  • the Info Dictionary, a limited set of key/value pairs
  • XMP packets, which contain RDF statements expressed as XML

PDF files

@hubgit
hubgit / container.sh
Created June 20, 2025 22:21
Open the current directory in a Docker container
# Open the current directory in a Docker container
function container() {
IMAGE=${1:-ubuntu:questing}
echo "Opening $PWD in $IMAGE"
docker run --rm -it -v "$PWD":/workspace -w /workspace "$IMAGE" bash
}
@hubgit
hubgit / index.html
Last active June 16, 2025 07:38
Render the text of a PDF with PDF.js
<!doctype html>
<meta charset="utf-8">
<title>Render the text of a PDF with PDF.js</title>
<style>
.page-container {
box-shadow: 0 1px 3px #444;
position: relative;
font-size: 1px;
line-height: 1;
@hubgit
hubgit / tex.sh
Last active June 15, 2025 20:43
Convert tex.web to tex.pa
# install Free Pascal
brew install fpc
wget --no-verbose http://mirrors.ctan.org/systems/knuth/dist.zip
wget --no-verbose http://mirrors.ctan.org/systems/knuth/local.zip
wget --no-verbose http://mirrors.ctan.org/systems/unix/tex-fpc.zip
unzip '*.zip'
cd tex-fpc/
@hubgit
hubgit / .zshrc
Created June 15, 2025 20:14
Open the current directory in a Docker container (zsh function)
# Open the current directory in a Docker container
function container() {
IMAGE=${1:-ubuntu:questing}
echo "Opening $PWD in $IMAGE"
docker run --rm -it -v "$PWD":/workspace -w /workspace "$IMAGE" bash
}
# Open the current directory in a Docker container (amd64)
function containeramd() {
IMAGE=${1:-ubuntu:questing}
@hubgit
hubgit / README.md
Last active May 12, 2025 09:45
A5 printed card with HTML + CSS
  1. Clone this Gist.
  2. For card sizes other than A5, edit the size value in @page, and the height and width properties of body.
  3. Add contents to each face. The simplest approach is to add an image called front.png of the same dimensions as the card.
  4. Generate a PDF from the HTML + CSS. If using Prince, it's as simple as prince index.html card.pdf.
  5. Take the PDF to a printer, and ask them to print as many copies as you need.
@hubgit
hubgit / index.html
Last active April 6, 2025 16:37
Expand a textarea to fit its content, between a minimum ("rows" attribute) and maximum ("max-rows" attribute) number of rows.
<script src="https://code.jquery.com/jquery-2.2.2.min.js"></script>
<script src="textarea-max-rows.js"></script>
<style>textarea { width: 100%; }</style>
<textarea rows="5" max-rows="20" placeholder="Enter content to see the textarea expanding…"></textarea>