Skip to content

Instantly share code, notes, and snippets.

goretkin / hex.svg
Created May 13, 2021
matplotlib polycollection svg
View hex.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
goretkin / robot.jl
Last active May 12, 2021
swept volume computation for GridVAMP
View robot.jl
using LazySets: UnionSetArray, LineSegment, BallInf
using ReachabilityAnalysis
using Colors: @colorant_str
import LinearAlgebra
using CartesianIndexSets: CartesianIndexSet
import PlotUtils
using PlotUtils: RGBA
using RecipesBase
goretkin / atom-boot-repl.jl
Last active Apr 16, 2021
View atom-boot-repl.jl
# from
using Pkg
# NOTE: No single quotes. File needs to be shorter than 2000 chars.
if VERSION > v"0.7-"
port = parse(Int, popfirst!(Base.ARGS))

sentence-per-line, no em-dash spaces:

The food—which was delicious—reminded me of home. The food, which was delicious, reminded me of home.

clause-per-line, inconsistent em-dash spaces:

The food —which was delicious—

goretkin / laz.jl
Created Jun 16, 2020
lazy map field access
View laz.jl
using Test
using BenchmarkTools
using DataStructures: OrderedDict
using MappedArrays: mappedarray
# use the iterator interface
function foo(a)
r = nothing
for x in a
goretkin / curry.jl
Last active Jun 7, 2020
Julia `Bind`, defer evaluation for some symbolic reasoning
View curry.jl
# See
using Base: tail
interleave(bind::Tuple{}, args::Tuple{}) = ()
interleave(bind::Tuple{}, args::Tuple) = error("more args than positions")
interleave(bind, args) = _interleave(first(bind), tail(bind), args)
# `nothing` indicates a position to be bound
_interleave(firstbind::Nothing, tailbind::Tuple, args::Tuple) = (
first(args), interleave(tailbind, tail(args))...)
goretkin / short-circuit-trivalent.jl
Last active Apr 23, 2020
short circuit trivalent logic
View short-circuit-trivalent.jl
import PrettyTables
macro and(p, q)
vp = $(esc(p))
if !ismissing(vp)
if vp
View parameterization.jl
using LinearAlgebra: norm
using Zygote
using Plots
A = rand(2,2)
b = rand(2)
A = [0.511125 0.493421; 0.987115 0.260349]
b = [0.205398, 0.282329]
View segment_distance_gui.jl
using LinearAlgebra
using PyPlot
using GeometryTypes
using EnhancedGJK
using Setfield #
import Polyhedra
import CoordinateTransformations
View acrobot_missing_tip_body.urdf
<?xml version="1.0"?>
<robot name="DoublePendulum">
<link name="base_link">
<box size=".2 .2 .2" />
<material name="green">
<color rgba="0 1 0 1" />