Skip to content

Instantly share code, notes, and snippets.

@lebarsfa
lebarsfa / import.m
Last active March 6, 2024 22:14 — forked from jaeandersson/import.m
Import a package into Octave using the syntax "import packagename.*" or "import py.packagename.*" if using Pythonic
function import(varargin)
% Import a package. Only entire packages can be imported currently.
error(nargchk(1,inf,nargin,'struct'));
% Import the packages one-by-one.
for i=1:nargin
[pkgname,names]=import1(varargin{i});
% Pythonic specific case...
for j=1:length(names)
assignin('caller',char(names{j}),pyeval({[pkgname '.' char(names{j})]}));
end
@lebarsfa
lebarsfa / refreshenv.bashrc
Last active February 4, 2024 22:54 — forked from Villenny/refreshenv.bashrc
Chocolatey refreshenv for GIT Bash.
function refreshenv
{
powershell -NonInteractive - <<EOF
\$filename="\$env:TEMP\refresh.env"
Write-Host("Updating environment session from chocolatey")
Set-ExecutionPolicy Bypass -Scope Process -Force
Import-Module "\$env:ChocolateyInstall\\helpers\\chocolateyProfile.psm1"
Update-SessionEnvironment
Write-Host("Scanning env")