Skip to content

Instantly share code, notes, and snippets.

@GiulioCentorame
GiulioCentorame / doom_wsl2.md
Last active March 20, 2023 08:16
Doom Emacs on WSL2
@amb
amb / fft.nim
Created May 12, 2022 12:43
Simple Nim FFT
# OTFFT library
# http://wwwa.pikara.ne.jp/okojisan/otfft-en/optimization1.html
# This is +20-50% improvement
const thetaLutSize = 2048
const thetaLut = static:
var arr: array[thetaLutSize, Complex[float]]
let step = 2.0*PI/float(thetaLutSize)
for k, v in mpairs(arr):
v = complex(cos(step * float(k)), -sin(step * float(k)))
@timm
timm / cli.lisp
Last active October 10, 2022 17:34
Process command line flags. So simple. Who needs docopt, click, fire, argparse, etc?
(defun argv () sb-ext:*posix-argv*)
(defmacro while (expr &body body)
`(do ((now ,expr ,expr)) ((not now)) ,@body))
(defun deepcopy (x)
(if (atom x) x (mapcar #'deepcopy x)))
(defun cli (flags &key
(help "help")
@npicciani
npicciani / snakemake.md
Last active November 2, 2023 18:12
Snakemake cheat sheet

Snakemake cheat sheet (coupled with github)

You can find the documentation here.

Installing snakemake on Farnam

You can easily install snakemake on Farnam with mamba:

module load miniconda
@yudhastyawan
yudhastyawan / c_penjumlahan.f90
Created May 24, 2021 12:49
embed Fortran in Python using Cython
module penjumlahan_interface
use iso_c_binding, only: c_double
use penjumlahan_module, only: penjumlahan
implicit none
contains
subroutine c_penjumlahan(a, b, c) bind(c)
real(c_double), intent(in) :: a, b
real(c_double), intent(out) :: c
call penjumlahan(a, b, c)
@blakeNaccarato
blakeNaccarato / $1 WSL2 Setup.md
Last active November 5, 2022 21:43
[20/08/25] A guide to setting up Windows Subsystem for Linux 2 (WSL2) in Windows 10 version 2004

WSL2 Setup [20/08/25]

First, execute these commands in Windows pwsh/cmd to ensure the proper features are turned on.

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Then, update the [WSL 2 Linux kernel].

@fardjad
fardjad / debian-sid-with-systemd-on-wsl2.md
Last active June 28, 2024 04:15
[Debian sid with systemd on WSL2] Instructions for running Debian sid with systemd on WSL2 #windows #wsl2 #debian #sid #linux
@andyneff
andyneff / cygwin xserver.md
Last active January 17, 2023 21:15
Modified Cygwin startxwin script that syncs X11 with WSL

Using cygwin X in WSL1 and MingW (and others)

Cygwin comes with an X Server that can be useful with tools other than Cygwin itself. With a few modifications, we can add cygwin's X Server support to other shell implementations including cygwin, mingw64 (such as git for windows), msys2, WSL1, WSL2, and others.

With a few minor modifications, we can save the DISPLAY variable to files accessible by any shell. Once the DISPLAY value is accessible, an rc file can load it and it will automatically be used.

Optionally, we can even add a "one click" link to the start menu to start the xserver

TL;DR

<#
.SYNOPSIS
Reset-WindowsUpdate.ps1 - Resets the Windows Update components
.DESCRIPTION
This script will reset all of the Windows Updates components to DEFAULT SETTINGS.
.OUTPUTS
Results are printed to the console. Future releases will support outputting to a log file.
# load test image
using Makie
using AbstractPlotting: limits
# The data
"""
Very simple resampling of an index range
"""
function resample(range)