Skip to content

Instantly share code, notes, and snippets.


Ashwin V. Mohanan ashwinvis

View GitHub Profile
ashwinvis / shell.nix
Created Feb 28, 2022
Execute rootless Docker to build conda-forge recipes locally via `nix-shell`
View shell.nix
# Copyright 2022 Ashwin V. Mohanan
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
{ pkgs ? import <nixpkgs> {} }:
ashwinvis / already_included_in_glossario.xsh
Last active Sep 30, 2021
Check if a term is already included in glossario
View already_included_in_glossario.xsh
#!/usr/bin/env xonsh
# Requires: xonsh, awk
# git clone
# cd glossario
# xonsh already_included_in_glossario.xsh
slugs = [
ashwinvis /
Last active Oct 20, 2020
Backup virtualenv before a Python 3.x upgrade and restore / recreate after the upgrade
cd ~
pip freeze --user --exclude-editable > REQUIREMENTS.txt
cd $WORKON_HOME # or wherever you store your virtualenvs
for activate in ./*/bin/activate
source $activate
ashwinvis /
Last active Jul 7, 2020
GitHub Retro
ashwinvis /
Created Apr 2, 2020
Conda packages to pip packages convertor
conda env export > environment.yml
# exclude pure python packages
grep -v .*=py..$ environment.yml > conda_environment.yml
# extract pure python packages under - pip:
grep .*=py..$ environment.yml | awk -F= '{print " "$1"=="$2}' >> conda_environment.yml
ashwinvis / LU_decomposition.ipynb
Created Mar 9, 2020 — forked from jfpuget/LU_decomposition.ipynb
A Speed Comparison Of C, Julia, Python, Numba, and Cython on LU Factorization
View LU_decomposition.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
ashwinvis / en_SE
Created Jan 8, 2020 — forked from bmaupin/en_SE
en_SE locale
View en_SE
escape_char /
comment_char %
% This file was generated by taking the LC_TIME section from en_US and
% replacing date/time representation with that of sv_SE from the glibc
% locale sources
% (;a=tree;f=localedata/locales;hb=HEAD)
% (
% This file is part of the GNU C Library and contains locale data.
ashwinvis /
Created Jun 29, 2017
CPAN and GNU stow installation
# Set up CPAN
# Append the following lines to .bashrc / .profile
# PERL_DIR=$HOME/.perl
# export PATH=$PERL_DIR/bin:$PATH
# export PERL5LIB=$PERL_DIR/lib/perl5
# PERL_MB_OPT="--install_base \"${PERL_DIR}\""; export PERL_MB_OPT;
ashwinvis /
Created Jul 29, 2019
A Fizzbuzz implementation: modular and extensible
lookup = {3: "Fizz", 5: "Buzz"}
def is_multiple(n, m):
return n % m == 0
def fizzbuzz(n):
output = ""
for m, string in lookup.items():
ashwinvis / following.ipynb
Last active Jul 13, 2019
View statistics and organize your Mastodon following into lists
View following.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.