This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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})" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 <[email protected]> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) { |
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]