Skip to content

Instantly share code, notes, and snippets.

View jan-glx's full-sized avatar

Jan Gleixner jan-glx

View GitHub Profile
@yihui
yihui / warnings.R
Created September 22, 2013 04:05
this shows the correct way to suppress warnings is suppressWarnings() instead of options(warn = -1) alone; similarly, you should use suppressMessages() to suppress messages
options(warn = -1)
# cannot really suppress warnings from the root level
withCallingHandlers(warning("hi"), warning = function(w) {
print(w)
})
# the warning can still be captured:
## <simpleWarning in withCallingHandlers(warning("hi"), warning = function(w) { print(w)}): hi>
# however, this always works
@noamross
noamross / google_wordcloud.R
Created April 22, 2015 01:13
Create a wordcloud of your google search history
# Script to make a word cloud of your google searches. Get your google search
# history at http://history.google.com. This script assumes the JSON files
# exported are in a 'Searches' subfolder
library(jsonlite)
library(rlist)
library(magrittr)
library(stringi)
library(wordcloud)
library(tm)
@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@stefansundin
stefansundin / openssh-7.3.sh
Last active September 13, 2022 21:03
Install OpenSSH 7.3 in Ubuntu 16.04
# WARNING: Use this at your own risk. It will probably break your other packages and cause other havoc.
# These days you should just upgrade to Ubuntu 18.04.
$ ssh -V
OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g 1 Mar 2016
wget https://launchpadlibrarian.net/277739251/openssh-client_7.3p1-1_amd64.deb
wget https://launchpadlibrarian.net/298453050/libgssapi-krb5-2_1.14.3+dfsg-2ubuntu1_amd64.deb
wget https://launchpadlibrarian.net/298453058/libkrb5-3_1.14.3+dfsg-2ubuntu1_amd64.deb
wget https://launchpadlibrarian.net/298453060/libkrb5support0_1.14.3+dfsg-2ubuntu1_amd64.deb
@konrad
konrad / doi2bibtex.sh
Last active August 23, 2017 08:52
Returns a BibTeX entry for one or more given DOIs.
#!/usr/bin/env bash
# Returns a BibTeX (www.bibtex.org) entry for one or more given DOIs
# (https://www.doi.org/).
#
# Call it like this:
#
# $ doi2bibtex.sh 10.1093/bioinformatics/btu533
#
# Can also be used for several DOIs at once: