Skip to content

Instantly share code, notes, and snippets.

View psychelzh's full-sized avatar
🎯
Focusing

Liang Zhang psychelzh

🎯
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:

@hkuno9000
hkuno9000 / git-diff-excel.md
Last active December 30, 2023 13:47
How to git diff for MS-Excel files(xls/xlsx) on Windows-OS

How to git diff for MS-Excel files(xls/xlsx) on Windows-OS

  1. Download the xdoc2txt tool from: http://ebstudio.info/home/xdoc2txt.html#download
  2. extract "xdoc2txt.exe" and locate it on your PATH folder
  3. edit your gitattributes as A:
  4. edit your gitconfig as B:

A: append following texts to "~/.config/git/attributes" or ".git/info/attributes"

*.xls	diff=xdoc2txt
@PurpleBooth
PurpleBooth / README-Template.md
Last active March 24, 2024 02:11
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

stat_smooth_func <- function(mapping = NULL, data = NULL,
geom = "smooth", position = "identity",
...,
method = "auto",
formula = y ~ x,
se = TRUE,
n = 80,
span = 0.75,
fullrange = FALSE,
level = 0.95,
@JosefJezek
JosefJezek / human-readable-format.md
Last active June 19, 2018 03:45
Human Readable Format
@nightire
nightire / 解决 Git 在 windows 下中文乱码的问题.md
Last active February 22, 2024 04:27
解决 Git 在 windows 下中文乱码的问题

解决 Git 在 windows 下中文乱码的问题

原因

中文乱码的根源在于 windows 基于一些历史原因无法全面支持 utf-8 编码格式,并且也无法通过有效手段令其全面支持。

解决方案

  1. 安装
#' Convert a list of vectors to a data frame.
#'
#' This function will convert a list of vectors to a data frame. This function
#' will handle three different types of lists of vectors. First, if all the elements
#' in the list are named vectors, the resulting data frame will have have a number
#' of columns equal to the number of unique names across all vectors. In cases
#' where some vectors do not have names in other vectors, those values will be
#' filled with \code{NA}.
#'
#' The second case is when all the vectors are of the same length. In this case,
@dsparks
dsparks / cairographics.R
Created September 24, 2012 19:12
Using cairographics with ggsave()
# .png with Windows GDI versus .png with cairographics
doInstall <- TRUE # Change to FALSE if you don't want packages installed.
toInstall <- c("ggplot2", "RColorBrewer", "Cairo")
if(doInstall){install.packages(toInstall, repos = "http://cran.us.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
# Generate some data
nn <- 100
myData <- data.frame(X = rnorm(nn),