Skip to content

Instantly share code, notes, and snippets.

View knbknb's full-sized avatar
💭
🙅‍♀️💡💤😴🛌🤪🧔

Knut Behrends knbknb

💭
🙅‍♀️💡💤😴🛌🤪🧔
View GitHub Profile
@knbknb
knbknb / query-pubmed-3-terms.R
Last active December 24, 2020 11:49 — forked from leipzig/microarray.R
Pubmed Queries: last paper on microarray bioinformatics, when to appear?
# Tidyverse-R-code from 2020
# (this code is also artificially slowed down, with purrr::slowly(),
# to avoid HTTP 429 errors (too many requests)
library(tidyverse)
library(httr)
library(xml2)
library(lubridate)
theme_set(theme_bw())
@knbknb
knbknb / amzn.csv
Created January 17, 2018 18:28 — forked from lebek/amzn.csv
Responsive Visualizations: Basic Graph
date close
2014-02-07 361.08
2014-02-06 354.59
2014-02-05 346.45
2014-02-04 347.95
2014-02-03 346.15
2014-01-31 358.69
2014-01-30 403.01
2014-01-29 384.2
2014-01-28 394.43
@knbknb
knbknb / .eslintrc.json
Created October 5, 2018 20:29 — forked from coryhouse/.eslintrc.json
.eslintrc.json file for "Building a JavaScript Development" Pluralsight course
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings"
],
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "module"
@knbknb
knbknb / node-client-server-todolist-mini-cli-app.md
Last active November 18, 2018 10:11
a TODO-list CLI app implemented using only builtin node modules (EventEmitter, process, readline)

Run the app on the command line with: node client.js. This implicitly loads server.js.

From Samir Buna's "Advanced NodeJS" course on Pluralsight

client.js

const EventEmitter = require('events');
const readline = require('readline');

const rl = readline.createInterface({
@knbknb
knbknb / postman-pre-request-mdis.js
Last active August 7, 2019 21:40 — forked from bcnzer/postman-pre-request.js
Postman pre-request script to automatically get a bearer token from our custom software 'mDIS' and save it for reuse
// set these variables on the folder level
// also select Postman No-Authentication option, and then set your own HTTP Autorization Header
var url = pm.variables.get('baseUrl') + "/api/v1/auth/login";
var username = pm.variables.get('username');
var password = pm.variables.get('password');
const echoPostRequest = {
url: url,
method: 'POST',
header: 'Content-Type:application/json',
body:
@knbknb
knbknb / wget-examples.sh
Last active April 14, 2022 13:54 — forked from bueckl/wget
wget examples - from labnol.org
###### Spider Websites with Wget 20 Practical Examples
# original, from 2019:
# https://www.labnol.org/software/wget-command-examples/28750/
###### Spider Websites with Wget 20 Practical Examples
# wget is extremely powerful, but like with most other command line programs,
# the plethora of options it supports can be intimidating to new users.
# Thus what we have here are a collection of wget commands that you can use
# to accomplish common tasks from downloading single files to mirroring entire websites.
# It will help if you can read through the wget manual but for the busy souls,
@knbknb
knbknb / exa-config.sh
Last active April 10, 2022 09:15 — forked from louiskounios/exa-config.sh
exa useful aliases, and EXA_COLORS (/ LS_COLORS) config
alias ls='exa --classify --across'
alias l='exa --classify --oneline'
alias ll='exa --classify --long --group'
alias llg='exa --classify --long --grid --group'
alias tree='exa --classify --tree'
alias lrt='exa --classify --long --group --sort newest'
# When --long --grid are used at the same time, --grid will only apply if the
# resulting output will be at least EXA_GRID_ROWS long.
export EXA_GRID_ROWS=3
@knbknb
knbknb / NodeJS-Cheatsheet.js
Last active April 14, 2022 11:36 — forked from devmoreno/CheatCheat.js
Collection of Node.js Codesnippets, from various sources, 2016
// Node.js CheatSheet.
// Credit:
// forked from Github gist: devmoreno/CheatCheat.js
// source URL: https://gist.github.com/devmoreno/f8db88351bc10e2a82e02dc0b06e68dd
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
@knbknb
knbknb / doi_resolver.py
Created May 19, 2022 13:31 — forked from mirekys/doi_resolver.py
Resolves a DOI identifier and returns record metadata in JSON format
#!/usr/bin/env python3
# pip install crossrefapi
from crossref.restful import Works
import requests
"""
Simple client for CrossRef DOI content negotiation
Tries to resolve a given DOI with CrossRef API.
If it fails (e.g. DOI is not minted by the CrossRef agency),
wget -O /tmp/YaHei.Consolas.1.12.zip https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/uigroupcode/YaHei.Consolas.1.12.zip
unzip /tmp/YaHei.Consolas.1.12.zip
sudo mkdir -p /usr/share/fonts/consolas
sudo mv YaHei.Consolas.1.12.ttf /usr/share/fonts/consolas/
sudo chmod 644 /usr/share/fonts/consolas/YaHei.Consolas.1.12.ttf
cd /usr/share/fonts/consolas
sudo mkfontscale && sudo mkfontdir && sudo fc-cache -fv