Skip to content

Instantly share code, notes, and snippets.

View adRn-s's full-sized avatar

A.s. adRn-s

View GitHub Profile
@Chaser324
Chaser324 / GitHub-Forking.md
Last active May 31, 2024 12:21
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@Kartones
Kartones / postgres-cheatsheet.md
Last active June 7, 2024 13:13
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
KEYBINDINGS
byobu keybindings can be user defined in /usr/share/byobu/keybindings/ (or within .screenrc if byobu-export was used). The common key bindings
are:
F2 - Create a new window
F3 - Move to previous window
F4 - Move to next window
msg <- function(..., prob = 0.25) {
if (runif(1) > prob) {
return(invisible())
}
messages <- c(...)
message(sample(messages, 1))
}
encourage <- function() {
@jumanjiman
jumanjiman / harden.sh
Last active February 1, 2024 14:27
hardening script for an alpine docker container
#!/bin/sh
# Copyright 2020 Paul Morgan
# License: GPLv2 (https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
set -x
set -e
#
# Docker build calls this script to harden the image during build.
#
# NOTE: To build on CircleCI, you must take care to keep the `find`
# command out of the /proc filesystem to avoid errors like:
@oliworx
oliworx / full-xfs-backup
Created March 25, 2016 11:57
very fast full backup of XFS partition with xfdump and lzo compression
sudo xfsdump -L KW12 -M FullBackup -J - / |lzop > /media/oli/465GB/Backup/Oli/Vostro/Linux-xfsdump-2016-03-26.lzo
## Explanation:
# sudo xfsdump
# -> start the xfsdump programm with root privileges
# -L KW12
# -> gives the Backup the label KW12
# -M FullBackup
@RLesur
RLesur / sort_definition_list.lua
Created October 27, 2018 23:22
A pandoc lua filter that sorts definition lists
DefinitionList = function(dl)
local terms = {}
local inlines = {}
local blocks = {}
local sorted = {}
for i, item in ipairs(dl.content) do
local term = string.upper(pandoc.utils.stringify(item[1])) --string.upper() is used because all the terms were not capitalized in the example
table.insert(terms, term)
inlines[term] = item[1]
blocks[term] = item[2]
---
title: Glossary
output:
bookdown::pdf_document2:
template: two-col.latex
latex_engine: xelatex
number_sections: FALSE
toc: False
pandoc_args: ["--lua-filter", "sort_definition_list.lua"]
includes:
@federicomarini
federicomarini / iSEE_plug.R
Last active April 20, 2023 09:54
A function to wrap up the DESeq2 inputs&outputs, and plug that as SingleCellExperiment into iSEE
library(DESeq2)
wrapup_for_iSEE <- function(dds, res) {
# dds to vst
vst <- vst(dds)
# initialize the container
se <- SummarizedExperiment(
assays = List(
counts = counts(dds),
@jetersen
jetersen / add-cert.py
Created March 8, 2020 09:00
Python: add custom root ca to certifi store
import requests
import certifi
import sys
try:
requests.get('https://any-website-protected-by-your-custom-root-ca')
print('Certificate already added to the certifi store')
sys.exit(0)
except requests.exceptions.SSLError as err:
print('SSL Error. Adding custom certs to Certifi store...')