Skip to content

Instantly share code, notes, and snippets.

local enummt = {
__index = function(table, key)
if rawget(table.enums, key) then
return key
end
end
}
local function Enum(t)
local e = { enums = t }
@espdev
espdev / crspline_curve.m
Last active May 15, 2020 08:44
Catmull-Rom cubic spline interpolation [Matlab]
function varargout = crspline_curve(varargin)
%CRSPLINE_CURVE Конструирует двумерную кривую кубическим Catmull-Rom интерполяционным сплайном
%
% Описание:
% Функция конструирует двумерную кривую по узловым точкам, используя
% Catmull-Rom интерполяционные кубические сплайны.
% Данные сплайны могут локально контролироваться и проходят по
% узловым точкам, а не в выпуклой их оболочке.
%
% Литература:
@t-nissie
t-nissie / quicksort.f
Last active January 31, 2023 18:49
quick sort in Fortran
! quicksort.f -*-f90-*-
! Author: t-nissie
! License: GPLv3
! Gist: https://gist.github.com/t-nissie/479f0f16966925fa29ea
!!
recursive subroutine quicksort(a, first, last)
implicit none
real*8 a(*), x, t
integer first, last
integer i, j
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule