Skip to content

Instantly share code, notes, and snippets.

View BroVic's full-sized avatar
🎯
Focusing

Victor Ordu BroVic

🎯
Focusing
View GitHub Profile
@djfdyuruiry
djfdyuruiry / README.md
Last active March 7, 2024 16:35
WSL 2 - Enabling systemd

Enable systemd in WSL 2

NOTE: If you have Windows 11 there is now an official way to do this in WSL 2, use it if possible - see MS post here (WINDOWS 11 ONLY)

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

@jennybc
jennybc / 2020-03-29_sane-legend.R
Created March 30, 2020 05:21
Make the legend order = data order, with forcats::fct_reorder2()
library(tidyverse)
library(patchwork)
dat_wide <- tibble(
x = 1:3,
top = c(4.5, 4, 5.5),
middle = c(4, 4.75, 5),
bottom = c(3.5, 3.75, 4.5)
)
@aeschright
aeschright / npm-strike.md
Last active September 8, 2021 16:32
A note about npm cli work status

When will npm@6.9.1 be released (and other PRs merged?)

On March 22, npm fired several members of the open source and community team for discussing workplace conditions and other labor organizing activities. As a result, core employee contributors to the npm cli were removed from the project, and others have left in solidarity or put their work on hold.

Multiple claims were filed with the NLRB on this matter. The NLRB has investigated and found sufficient evidence of validity to proceed. The National Labor Relations Act of 1935 protects US employees' right to engage in discussions of workplace concerns without threat of retaliation -- and awareness of the importance of how we treat each other is something I valued so much in collaborating with the cli team. How can we work together if we aren't free to discuss what we need?

It's disappointing for all of us to find the work we were doing interrup

@nuest
nuest / switching-from-XML-to-xml2.md
Last active March 6, 2024 17:07
Switching an R package from XML to xml2

Switching from XML to xml2

Rationale

The R package XML for parsing and manipulation of XML documents in R is not actively maintained anymore, but used by many:

The R package xml2 is an actively maintained, more recent alternative.

This file documents useful resources and steps for moving from XML to xml2.

@chrisidakwo
chrisidakwo / nigerian-states.json
Last active April 19, 2024 14:11
All 36 states in Nigeria, and their local government areas - including the Federal Capital Territory and its area councils
{
"Abia": [
"Aba North",
"Aba South",
"Arochukwu",
"Bende",
"Ikwuano",
"Isiala-Ngwa North",
"Isiala-Ngwa South",
"Isuikwato",
@mbinna
mbinna / effective_modern_cmake.md
Last active April 18, 2024 19:26
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@dncgst
dncgst / rgdal_install.md
Last active February 8, 2024 13:45
How to install the rgdal R package

How to install the rgdal R package

> install.packages("rgdal")

  • installing source package ‘rgdal’ ... configure: error: gdal-config not found or not executable.

The packages libgdal-dev and libproj-dev are required:

sudo apt-get install gdal-bin proj-bin libgdal-dev libproj-dev

@dmode
dmode / build.ps1
Created November 18, 2016 10:25
Powershell script to convert a markdown file into an word document by using pandoc
<#
.SYNOPSIS
Script to convert markdown file to word document
.DESCRIPTION
Convertes a markdown file into an word document using pandoc as converter. The process uses a word template file
.PARAMETER i
Specifies the input file. This is the markdown file
.PARAMETER o
Specifies the output file. This is the word document
.PARAMETER t
@wojteklu
wojteklu / clean_code.md
Last active April 26, 2024 03:00
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@mick001
mick001 / logistic_regression.R
Last active October 1, 2023 10:22
Logistic regression tutorial code. Full article available at http://datascienceplus.com/perform-logistic-regression-in-r/
# Load the raw training data and replace missing values with NA
training.data.raw <- read.csv('train.csv',header=T,na.strings=c(""))
# Output the number of missing values for each column
sapply(training.data.raw,function(x) sum(is.na(x)))
# Quick check for how many different values for each feature
sapply(training.data.raw, function(x) length(unique(x)))
# A visual way to check for missing data