Skip to content

Instantly share code, notes, and snippets.

View yfyf's full-sized avatar

Ignas Vyšniauskas yfyf

View GitHub Profile
@yfyf
yfyf / export_pose_graph.py
Last active December 20, 2022 07:19 — forked from mjcarroll/export_pose_graph.py
Cartographer Pose Graph
#!/usr/bin/env python3
# Adapted from:
#
# https://gist.github.com/mjcarroll/f620ef8d88efc3a03711259d6fc9a578
#
# Original gist fixed to work with latest version of cartographer:
#
# [~/sensmetry/slam/cartographer:master]λ git describe --always
# bcd5486
@yfyf
yfyf / abt.hs
Last active August 29, 2015 14:21 — forked from pchiusano/abt.hs
-- A port of: http://semantic-domain.blogspot.com/2015/03/abstract-binding-trees.html
{-# LANGUAGE DeriveFunctor #-}
module ABT where
import qualified Data.Foldable as Foldable
import Data.Foldable (Foldable)
import Data.Set (Set)
import qualified Data.Set as Set
@yfyf
yfyf / happy.hs
Last active August 29, 2015 14:21
Spot the error
happyNewToken action sts stk
= lexwrap(\tk ->
let cont i = happyDoAction i tk action sts stk in
case tk of {
alexEOF -> happyDoAction 18# tk action sts stk;
TokenLet -> cont 1#;
TokenIn -> cont 2#;
TokenFresh -> cont 3#;
TokenSpawn -> cont 4#;
TokenEnd -> cont 5#;
@yfyf
yfyf / watcher.sh
Last active August 29, 2015 14:19
Inotify wrapper to refresh browser window on file update
#!/bin/bash
set -euo pipefail
FILE=$1
FILENAME=$(basename "$FILE")
BROWSER=iceweasel
OK=0
@yfyf
yfyf / cabal.config
Created March 31, 2015 08:48
Useful additions to ~/.cabal/config
-- Prevent working in non-sandboxed envs:
require-sandbox: True
-- Always enable test suite installation/building
tests: True
-- Always build documentation
documentation: True
-- Run (# of CPUs) build/fetch jobs in parallel
jobs: $ncpus
-- A few more options you might want to consider:
-- library-coverage: True
@yfyf
yfyf / primes.hs
Created February 25, 2015 10:06
Primes a la Yves Bertot
---- Prime sieve based on co-inductive streams
---- Taken from "Filters on coinductive streams, an application to
---- Eratosthenes’ sieve" by Yves Bertot
-- a 'stateful' filter
fm p n (x:xs) | (n < x) = fm p (n+p) (x:xs)
fm p n (x:xs) | (n == x) = fm p (n+p) xs
fm p n (x:xs) | (x < n) = x : (fm p n xs)
primes = sieve [2..] where
@yfyf
yfyf / bad.html
Last active August 29, 2015 14:16
Pandoc issue
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="generator" content="pandoc">
<title></title>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="reveal.js/css/reveal.min.css"/>
@yfyf
yfyf / beam.rst
Last active August 29, 2015 14:15 — forked from kuenishi/beam.rst

BEAM

assemble

$ erlc -S test.erl
@yfyf
yfyf / update-resolv-conf
Created March 25, 2014 18:06
Update resolv.conf using openresolv with (DNS) settings pushed by OpenVPN
#!/bin/bash
#
# Requires openresolv.
#
# This file goes into
#
# /usr/share/openvpn/update-resolv-conf
#
# And this goes into your OpenVPN conf:
#
@yfyf
yfyf / PKGBUILD
Last active December 30, 2015 07:19
piqi PKGBUILD
# Maintainer: Taylor Venable <taylor@metasyntax.net>
pkgname=piqi-git
pkgver=20131204
pkgrel=1
pkgdesc='A set of languages and open-source tools for working with structured data.'
arch=('i686' 'x86_64')
url='http://piqi.org/'
license=('Apache')
makedepends=('git' 'ocaml' 'ocaml-findlib' 'pandoc')