Skip to content

Instantly share code, notes, and snippets.

View jp2011's full-sized avatar

Jan Povala jp2011

View GitHub Profile
@maltefiala
maltefiala / print2pdf.el
Last active September 28, 2022 10:23
emacs print-to-pdf on OSX
;; Adapted following script to OSX:
;; https://genomeek.wordpress.com/2013/03/08/emarch-2-create-a-pdf-with-highlighted-code-source/
(defun print-to-pdf ()
(interactive)
(ps-spool-buffer-with-faces)
(switch-to-buffer "*PostScript*")
(write-file "tmp.ps")
(kill-buffer "tmp.ps")
(setq cmd (concat "pstopdf tmp.ps -o " (buffer-name) ".pdf"))
(shell-command cmd)
@dannguyen
dannguyen / guardian-articles-day-api.md
Last active November 23, 2023 12:28
How to use The Guardian's API to download article data for content analysis (in Python 3.x)

How to use The Guardian's API to download article data for content analysis (in Python 3.x)

The Guardian offers an API as deep and robust as the New York Times Article API when it comes to content analysis.

The Guardian's API offers more than "1.7 million pieces of content", with published items as far back as 1999. You can register as a developer here, which gets you 5,000 API hits a day and an API key that looks something like this:

zzzyyyyy-9a9z-999z-z999-9e8a83922516

The Guardian has a handy interactive explorer to interactively tweak the query parameters.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thriveth
thriveth / CBcolors.py
Created January 22, 2014 14:52
A color blind/friendly color cycle for Matplotlib line plots. Might want to shuffle it around a bit more,but already not it gives kinda good contrasts between subsequent colors, and shows reasonably well in colorblind filters (though not in pure monochrome).
CB_color_cycle = ['#377eb8', '#ff7f00', '#4daf4a',
'#f781bf', '#a65628', '#984ea3',
'#999999', '#e41a1c', '#dede00']
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active November 15, 2024 09:51
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname