Skip to content

Instantly share code, notes, and snippets.

View vogler's full-sized avatar

Ralf Vogler vogler

  • Munich, Germany
  • 10:38 (UTC +02:00)
View GitHub Profile
@vogler
vogler / fix-search.aliexpress.tamper.js
Last active December 30, 2019 23:55
Tampermonkey: AliExpress: Orders: Enter = search, use https
// ==UserScript==
// @name AliExpress: Orders: Enter = search, use https
// @namespace https://gist.github.com/vogler
// @downloadURL https://gist.github.com/vogler/6d29fa58650fe976a5a4360be0a6b594/raw/fix-search.aliexpress.tamper.js
// @version 0.3
// @description Hitting 'Enter' should start the search in 'Orders', always use https
// @author Ralf Vogler
// @match *://trade.aliexpress.com/order*ist.htm*
// there are links to order_list.htm and orderList.html
// @grant none
type a = { id: number, name: string, foo: string }
type b = { id: string, name: string, bar: string }
type c = a | b
type d = a & b
type id = d['id'] // number & string = never (bot)
const va: a = {id: 1, name: 'ha', foo: 'foo'}
const vb: b = {id: '1', name: 'ha', bar: 'bar'}
const vc1: c = va
const vc2: c = vb
@vogler
vogler / cloudSettings
Last active July 8, 2021 11:44
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-07-08T11:44:12.260Z","extensionVersion":"v3.4.3"}
@vogler
vogler / zsh.md
Last active April 30, 2020 14:19

autocomplete requires too many tabs

sorin-ionescu/prezto#1725

Is it already possible to configure some of this in zsh? http://zsh.sourceforge.net/Doc/Release/Completion-System.html

Tried the following:

  • expand ❓: If one of its values is the string ‘suffix’, matching names for components after the first ambiguous one will also be added. This means that the resulting string is the longest unambiguous string possible. However, menu completion can be used to cycle through all matches.
@vogler
vogler / video-scroll-seek.tamper.js
Last active November 30, 2023 00:47
Tampermonkey: video: scroll=seek
// ==UserScript==
// @name Video: scroll=seek
// @namespace https://gist.github.com/vogler
// @downloadURL https://gist.github.com/vogler/b7c66088cd22f899496f353d5295b7ad/raw/video-scroll-seek.tamper.js
// @version 0.26
// @description Scrolling a video seeks back/forward
// @author Ralf Vogler
// @match *://*/*
// @grant none
// ==/UserScript==
@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==
@vogler
vogler / sVimrc
Last active May 22, 2018 13:30
sVim Options
set nosmoothscroll
map "s" nextTab
map "a" previousTab
@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 / 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"
}

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 *)