Skip to content

Instantly share code, notes, and snippets.

View bvn13's full-sized avatar
👨‍💻
let's code

Vyacheslav N. Boyko bvn13

👨‍💻
let's code
View GitHub Profile
@bvn13
bvn13 / README.MD
Created May 18, 2022 11:57 — forked from RichardBronosky/README.MD
cb - A leak-proof tee to the clipboard - Unify the copy and paste commands into one intelligent chainable command.

cb

A leak-proof tee to the clipboard

This script is modeled after tee (see [man tee][2]) and works on Linux, macOS, Cygwin, WSL/WSL2

It's like your normal copy and paste commands, but unified and able to sense when you want it to be chainable.

This project started as an answer to the StackOverflow question: [How can I copy the output of a command directly into my clipboard?][3]

@bvn13
bvn13 / ThrowingConsumer.java
Created February 2, 2022 15:55
Functional interface ThrowingConsumer wrapping all catchable exceptions to be used in Lambdas
import java.util.function.Consumer;
@FunctionalInterface
public interface ThrowingConsumer<T> extends Consumer<T> {
@Override
default void accept(final T elem) {
try {
acceptThrows(elem);
} catch (final Exception e) {
#!/bin/bash
#
# chkconfig: 2345 95 20
# description: Tomcat 8 start/stop/status init.d script
# processname: tomcat
#
# Tomcat 8 start/stop/status init.d script
#
# Updates:
# @author: Tongliang Liu <cooniur@gmail.com>
@bvn13
bvn13 / Symmetric.java
Created July 17, 2019 18:44 — forked from dwelch2344/Symmetric.java
A simple example of decrypting a symmetrically encrypted file (via GPG)
import org.apache.commons.io.FileUtils;
import org.bouncycastle.bcpg.SymmetricKeyAlgorithmTags;
import org.bouncycastle.openpgp.*;
import org.bouncycastle.openpgp.examples.ByteArrayHandler;
import org.bouncycastle.openssl.PEMReader;
import org.bouncycastle.util.io.Streams;
import java.io.*;
import java.security.NoSuchProviderException;
import java.security.Security;
package java2scala.homeworks
sealed trait LinkedMap[K, V] extends Traversable[(K, V)] {
override def toString: String = if (this.isInstanceOf[LinkedMap.Empty[K, V]]) {
s"(Empty)"
} else {
s"(Cons[${sKey.get},${sValue.get}],${sRest.get})"
}
@bvn13
bvn13 / ddos-triumph-hall.py
Last active October 10, 2018 19:06
Make a fake reservation into Moscow Triumph Hall restaurant
#!/usr/bin/python
# from: https://pikabu.ru/story/bitva_za_besplatnuyu_gorodskuyu_parkovku_6206986
import calendar
import time
from multiprocessing import Process
from random import randint, choice
import datetime
import requests
@bvn13
bvn13 / addEventListener-polyfill.js
Created July 27, 2016 10:24 — forked from eirikbacker/addEventListener-polyfill.js
addEventListener polyfill for IE6+
//addEventListener polyfill 1.0 / Eirik Backer / MIT Licence
(function(win, doc){
if(win.addEventListener)return; //No need to polyfill
function docHijack(p){var old = doc[p];doc[p] = function(v){return addListen(old(v))}}
function addEvent(on, fn, self){
return (self = this).attachEvent('on' + on, function(e){
var e = e || win.event;
e.preventDefault = e.preventDefault || function(){e.returnValue = false}
e.stopPropagation = e.stopPropagation || function(){e.cancelBubble = true}