This file contains 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.io.File; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.net.URL; | |
import java.nio.channels.Channels; | |
import java.nio.channels.ReadableByteChannel; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
public class TDownload { |
This file contains 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 scala.annotation.tailrec | |
object Main extends App { | |
sealed trait Node | |
case class Branch(value: Int, next: Node) extends Node | |
case class Leaf(value: Int) extends Node | |
def reverse: Node => Node = { | |
case Branch(value, next) => _reverse(Leaf(value), next) | |
case l @ Leaf(_) => l |
This file contains 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 example | |
sealed trait OptionZ[+T] { | |
def map[U](f: T => U): OptionZ[U] | |
def flatMap[U](f: T => OptionZ[U]): OptionZ[U] | |
def filter(f: T => Boolean): OptionZ[T] | |
def foreach(f: T => Unit): Unit |
This file contains 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
hs.window.animationDuration = 0 | |
units = { | |
right50 = { x = 0.50, y = 0.00, w = 0.50, h = 1.00 }, | |
left50 = { x = 0.00, y = 0.00, w = 0.50, h = 1.00 }, | |
top50 = { x = 0.00, y = 0.00, w = 1.00, h = 0.50 }, | |
bot50 = { x = 0.00, y = 0.50, w = 1.00, h = 0.50 }, | |
maximum = { x = 0.00, y = 0.00, w = 1.00, h = 1.00 } | |
} | |
hs.hotkey.bind({ 'ctrl', 'alt', 'cmd'}, 'n', function() |
This file contains 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
const replaceEncryptedFields = async ( | |
// eslint-disable-next-line | |
obj: any, | |
kmsDecryptFn: (encryptedValue: string) => Promise<string> | |
): Promise<void> => { | |
for (const [key, value] of Object.entries(obj)) { | |
if (typeof value === 'string' && value.startsWith(KMS_PREFIX)) { | |
const encryptedValue = value.slice(KMS_PREFIX.length, value.length); | |
obj[key] = await kmsDecryptFn(encryptedValue); | |
} else if (typeof value === 'object') { |
This file contains 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
call plug#begin('~/.vim/plugged') | |
Plug 'morhetz/gruvbox' | |
Plug 'ntpeters/vim-better-whitespace' | |
call plug#end() | |
set autoindent | |
set expandtab | |
set shiftround |
This file contains 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
#include <iostream> | |
template <uint64_t n> | |
struct Fact { | |
static const uint64_t value = n * Fact<n - 1>::value; | |
}; | |
template <> | |
struct Fact<1> { | |
static const uint64_t value = 1; |
This file contains 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
#include <algorithm> | |
#include <cctype> | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
int main(int argc, char *argv[]) { | |
if (argc < 2) { | |
exit(1); |