Skip to content

Instantly share code, notes, and snippets.

View Marlin-Na's full-sized avatar
💤
Waiting for Godot

Marlin Marlin-Na

💤
Waiting for Godot
  • Betelgeuse VII
View GitHub Profile
@m-radzikowski
m-radzikowski / script-template.sh
Last active May 4, 2024 04:13
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@jeroen
jeroen / shit.md
Last active March 4, 2022 07:18
Getting shit to work

Getting shit to work

Disclaimers

  • No authority
  • Official reference is writing r extentions (joke extentions)
  • If you thought writing regular r packages was tricky, hold on
@boneskull
boneskull / uninstall_vmware.sh
Created January 14, 2014 04:46
completely uninstall vmware on mac
#!/usr/bin/env bash
# Usage: bash uninstall_vmware.bash
remove() {
entry="$1"
echo -ne "Removing \e[1;34m$entry\e[0m... "
sudo rm -rf "$entry" &> /tmp/uninstall-vmware.log
if [[ ! -e "$entry" ]]; then
echo -e "\e[1;32mOK\e[0m"
@Sharpie
Sharpie / mRunif.c
Created March 6, 2010 04:44
An example of calling R functions from C
//myRunif.c
#include <R.h>
#include <Rinternals.h>
SEXP myRunif( SEXP n, SEXP min, SEXP max ){
SEXP statsPackage;
PROTECT(
statsPackage = eval( lang2( install("getNamespace"),
ScalarString(mkChar("stats")) ),