Skip to content

Instantly share code, notes, and snippets.

@runiq
runiq / extract_sequences_multi.py
Created November 14, 2013 15:01
Extract_sequences.py für mehrere CSV-Dateien
#! /usr/bin/env python2
import argparse
import csv
def write_sequence(name, sequence, fh):
fh.write("> " + name + "\n")
fh.write(sequence + "\n")
@runiq
runiq / PKGBUILD.diff
Created June 12, 2014 16:55
python2-keyring PKGBUILD diff with keyring2 executable
--- python2-keyring/PKGBUILD 2014-03-27 01:14:38.000000000 +0100
+++ python2-keyring-new/PKGBUILD 2014-06-12 18:48:44.685878925 +0200
@@ -17,6 +17,12 @@
'kdebindings-python2: Kde integration')
md5sums=('7746c545debacf983ec1c01966cacec3')
+prepare() {
+ cd "$srcdir/keyring-$pkgver"
+ # Install executable as keyring2
+ sed -i 's/keyring=keyring\.cli:main/keyring2\=keyring.cli:main/' setup.py
@runiq
runiq / PKGBUILD
Created July 9, 2014 16:39
python2-vdirsyncer 0.2.1 PKGBUILD
# Maintainer: Hugo Osvaldo Barrera <[email protected]>
pkgname=python2-vdirsyncer
_pkgname=vdirsyncer
pkgver=0.2.1
pkgrel=1
pkgdesc="Synchronize CalDAV and CardDAV"
arch=('any')
url="https://github.com/untitaker/vdirsyncer"
license=('MIT')
@runiq
runiq / SCGwN.py
Last active December 14, 2016 14:13
import re
tags = { 'otag': re.escape('{{'), 'ctag': re.escape('}}') }
# Taken from anki.template.template.Template.compile_regexps()
# section = r"%(otag)s[#^]([^}]*)%(ctag)s((?s).+?)%(otag)s/\1%(ctag)s" % tags
# tag = r"%(otag)s([=&!>{]?)((?![#^/]).+?)\1?%(ctag)s+"
sectionAndTag = r"""%(otag)s # Section regex first
([#^]) # Separates section from tag (#1)

Keybase proof

I hereby claim:

  • I am runiq on github.
  • I am runiq (https://keybase.io/runiq) on keybase.
  • I have a public key ASAIYFKfBT8PL84pP_-kN5wHrNsUYlZzchaVWkY1C7DMrwo

To claim this, I am signing this object:

@runiq
runiq / gist:ebc8d82159f464cce3096a15ebe16ba2
Created May 16, 2018 07:31
kubectl describe pod cilium-rdf7b -n kube-system
Name: cilium-rdf7b
Namespace: kube-system
Node: minikube/192.168.122.161
Start Time: Wed, 16 May 2018 09:27:54 +0200
Labels: controller-revision-hash=1419074980
k8s-app=cilium
kubernetes.io/cluster-service=true
pod-template-generation=1
Annotations: prometheus.io/port=9090
prometheus.io/scrape=true
@runiq
runiq / text_document_document_symbol.diff
Last active June 23, 2020 13:04
Patch for LCN's text_document_document_symbol()
diff --git i/src/language_server_protocol.rs w/src/language_server_protocol.rs
index 9922afa..e2916d9 100644
--- i/src/language_server_protocol.rs
+++ w/src/language_server_protocol.rs
@@ -1420,111 +1420,46 @@ impl LanguageClient {
let syms = <lsp_types::request::DocumentSymbolRequest as lsp_types::request::Request>::Result::deserialize(&result)?;
let title = format!("[LC]: symbols for {}", filename);
- let selection_ui = self.get(|state| state.selection_ui)?;
- let selection_ui_auto_open = self.get(|state| state.selection_ui_auto_open)?;
#######
LanguageClient 0.1.157 4b35f5d6859ab3d42546192cbede9add59a7435a
#######
10:01:27 DEBUG unnamed src/language_client.rs:78 state: null ==> {"apply_completion_additional_text_edits":true,"auto_start":true,"capabilities":{"rust":{"capabilities":{"callHierarchyProvider":true,"codeActionProvider":{"codeActionKinds":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]},"codeLensProvider":{"resolveProvider":true},"completionProvider":{"triggerCharacters":[":","."]},"definitionProvider":true,"documentFormattingProvider":true,"documentHighlightProvider":true,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":"=","moreTriggerCharacter":[".",">"]},"documentSymbolProvider":true,"foldingRangeProvider":true,"hoverProvider":true,"implementationProvider":true,"referencesProvider":true,"renameProvider":{"prepareProvider":true},"selectionRangeProvider":true,"semanticTokensProvider":{"documentProvider":true,"legend":{"tokenModifiers":["documentation
@runiq
runiq / patch.patch
Created August 6, 2020 17:51
Integrating snippets.nvim and completion-nvim
diff --git i/lua/completion.lua w/lua/completion.lua
index 1fed4f4..4c9774b 100644
--- i/lua/completion.lua
+++ w/lua/completion.lua
@@ -107,6 +107,8 @@ local function hasConfirmedCompletion()
api.nvim_input("<c-r>".."=neosnippet#expand('"..completed_item.word.."')".."<CR>")
elseif completed_item.kind == 'vim-vsnip' then
api.nvim_call_function('vsnip#expand', {})
+ elseif completed_item.kind == 'snippets.nvim' then
+ require'snippets'.expand_at_cursor()
@runiq
runiq / README.md
Last active July 9, 2024 15:35
Neovim throttle & debounce

What are these?

Functions that allow you to call a function not more than once in a given timeframe.

Throttling on the leading edge

This can be illustrated with timing diagrams. In the following diagrams, f designates call to the throttled function, t is the period where the timer is running, and x shows you the actual execution point of the throttled function.

f 1  2  3  4  5  6