Skip to content

Instantly share code, notes, and snippets.

View vogler's full-sized avatar

Ralf Vogler vogler

  • Munich, Germany
  • 20:48 (UTC +01:00)
View GitHub Profile
@vogler
vogler / gist:fc7d77c1fc424aa2902e
Last active February 12, 2018 21:22
cVim Options
set autoupdategist
set nosmoothscroll
set cncpcompletion
let blacklists = ["*://mail.google.com/*", "*://netflix.com/*"]
set noautofocus
let mapleader = ","
map <Leader>d :tabdetach<CR>
map <Leader>a :tabattach<Space>
map a previousTab
map s nextTab
@vogler
vogler / subtype.ml
Last active August 29, 2015 14:18
subtyping of polymorphic variants when using GADTs
type 'r t = A : [`A | `T] t | B : [`B | `T] t;; (* the information 'r : [> `T] seems to be missing *)
(* type _ t = A : [ `A | `T ] t | B : [ `B | `T ] t *)
(* the following works as expected: *)
let rec f : type r. r t -> r = function A -> `T | B -> `T;;
(* val f : 'r t -> 'r = <fun> *)
f A;;
(* - : [ `A | `T ] = `T *)
(* now f should be called on different modules for the same q, and the results should be combined *)

goblint jobs

All topics can also be done as hiwi jobs. Recommendations for theses:

  • ba = bachelor's thesis
  • ma = master's thesis

ba, ma specification system for library functions

See description

@vogler
vogler / README.md
Last active April 21, 2016 15:09
Goblint C library functions

Compilation and linking with undefined functions

GCC compilation process GCC compilation process

Linking fails if an undefined function is used:

❯ gcc test.c
Undefined symbols for architecture x86_64:

"_f", referenced from:

@vogler
vogler / lattice.ml
Created November 17, 2016 16:15
some lattice examples
(* REPL: #use "lattice.ml";; *)
#require "batteries";;
#require "ppx_deriving.std";;
open BatteriesExceptionless
let nopath x = let open String in let i = (rindex x '.' |? -1) + 1 in sub x i (length x - i);;
module type PartialOrder = sig
type d [@@deriving show, enum]
val leq : d -> d -> bool

This extension helps dealing with warning 57:

File "when.ml", line 28, characters 4-19:
Warning 57: Ambiguous or-pattern variables under guard;
variable x may match different arguments. (See manual section 8.5)

Problem

let f = function
 | A x, _ (* A 0, A 1 would match here and fail the guard *)
@vogler
vogler / dash.py
Created April 5, 2017 19:01
detects dash button presses
from scapy.all import *
from datetime import datetime
# blocked these macs in router to avoid notifications. however, this makes them try longer.
# fake server: https://github.com/ide/dash-button/issues/59
# maybe set google as primary dns and rpi as secondary: https://medium.com/@tombatossals/cheating-the-amazon-dash-iot-button-the-almost-easy-way-e5bc62f93f8c
macs = {
"ac:63:be:ea:5b:1b": "kleenex",
"ac:63:be:ba:2f:85": "oral-b"
}
@vogler
vogler / ppx_reflect.ml
Last active October 27, 2017 09:43
ppx_reflect
(** identifiers *)
(* name of identifier as string *)
let%id foo = declare Int
let foo = declare Int "foo"
(* name of module as string *)
module%id Foo = struct end
module Foo = struct let name = "Foo" end
module%id Foo (Bar : S) = struct end
@vogler
vogler / sVimrc
Last active May 22, 2018 13:30
sVim Options
set nosmoothscroll
map "s" nextTab
map "a" previousTab
@vogler
vogler / youtube-fullscreen-seek.js
Created June 13, 2018 20:07
Tampermonkey: YouTube: scroll=seek in fullscreen
// ==UserScript==
// @name YouTube: scroll=seek in fullscreen
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Scrolling a youtube video in fullscreen seeks back/forward
// @author Ralf Vogler
// @match https://www.youtube.com/*
// @grant none
// ==/UserScript==