Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@balta2ar
balta2ar / gist:b2d93882c69d9a66644508641984ec62
Created November 4, 2020 21:04 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structures
  1. General Background and Overview
@balta2ar
balta2ar / compinit.zsh
Created October 15, 2020 07:48 — forked from ctechols/compinit.zsh
Speed up zsh compinit by only checking cache once a day.
# On slow systems, checking the cached .zcompdump file to see if it must be
# regenerated adds a noticable delay to zsh startup. This little hack restricts
# it to once a day. It should be pasted into your own completion file.
#
# The globbing is a little complicated here:
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct.
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error)
# - '.' matches "regular files"
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours.
autoload -Uz compinit
@balta2ar
balta2ar / main.go
Created October 14, 2020 07:20
golisttests
package main
import (
"flag"
"fmt"
"go/ast"
"go/parser"
"go/token"
"os"
"path/filepath"
@balta2ar
balta2ar / google-calendar-automate-duplication.user.js
Created June 5, 2020 08:14
UserScript that helps you duplicate Google Calendar events quickly
// ==UserScript==
// @name google-calendar-automate-duplication
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Automate duplication of events
// @author Yuri Bochkarev
// @match https://calendar.google.com/calendar/*
// @grant none
// ==/UserScript==
@balta2ar
balta2ar / jira.py
Last active May 15, 2018 17:51
Deoplete sample prefix source
from .base import Base
def log(msg):
with open('/tmp/deoplete-jira.log', 'a') as file_:
file_.write('%s\n' % msg)
from jira_rt_completion_server.jira_completer import JiraCompleter
@balta2ar
balta2ar / nettop-tcp.stp
Created August 20, 2016 18:49
SystemTap script that displays top 4 processes that produce TCP traffic (in/out, KBytes)
#! /usr/bin/env stap
global ifxmit, ifrecv
global ifmerged
probe tcp.sendmsg.return
{
if (size > 0) {
ifxmit[pid(), "eth0", execname(), uid()] <<< size
}
@balta2ar
balta2ar / request_tracker.py
Created May 7, 2016 16:57
RT completer based on deoplete
"""
This is RT source plugin for deoplete. It completes RequestTicket numbers.
"""
from .base import Base
import re
from time import strftime
from pprint import pformat
CANDIDATES_FILENAME = '/tmp/rt.candidates.txt'
@balta2ar
balta2ar / rt_completer.py
Created April 14, 2016 08:39
RT completer based on YouCompleteMe
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import * # noqa
from ycmd.completers.general_completer import GeneralCompleter
from ycmd import responses
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# The script prints new packages' info:
# package name -> old version -> new version
# colorized for conky
#
import sys
import subprocess
#!/bin/sh
#
# $1 -- incoming bandwidth
# $2 -- outgoing bandwidth
#
# bandwidth.sh init -- modprobe && ip up
# bandwidth.sh x y -- set incoming bandwidth to x, outgoing to y
# bandwidth.sh -- remove limits
# bandwidth.sh - y -- remove incoming limits, set outgoing limit