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 logging | |
import click | |
class ColorFormatter(logging.Formatter): | |
colors = { | |
"error": dict(fg="red"), | |
"exception": dict(fg="red"), | |
"critical": dict(fg="red"), |
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/env bash | |
# Usage: log_warning [<message> ...] | |
# | |
# Logs a warning message. Acts like echo, | |
# but wraps output in the standard direnv log format | |
# (controlled by $DIRENV_LOG_FORMAT), and directs it | |
# to stderr rather than stdout. | |
# | |
# Example: |
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
diff --git a/src/results_notebooks/optimizely/api.py b/src/results_notebooks/optimizely/api.py | |
index 2eb2fa2..6132c4c 100644 | |
--- a/src/results_notebooks/optimizely/api.py | |
+++ b/src/results_notebooks/optimizely/api.py | |
@@ -13,7 +13,7 @@ See Also | |
import datetime | |
import os | |
import re | |
-from typing import ClassVar, Generic, List, Optional, Type, TypeVar | |
+from typing import ClassVar, Dict, Generic, List, Type, TypeVar |
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 itertools | |
from typing import Iterable | |
import dask | |
import dask.core | |
import dask.multiprocessing | |
import dask.optimization | |
class LazyGraph: |
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
defmodule TicTacToe do | |
defmodule Board do | |
def create(maxX \\ 3, maxY \\ 3) do | |
for x <- 0..(maxX - 1), | |
y <- 0..(maxY - 1) do | |
{{x, y}, nil} | |
end | |
|> Map.new() | |
|> Map.put_new(:maxY, maxY) | |
|> Map.put_new(:maxX, maxX) |
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 kotlin.properties.ReadWriteProperty | |
import kotlin.reflect.KProperty | |
fun <V> map(props: Props, key: String): ReadWriteProperty<Any?, V> { | |
return object : ReadWriteProperty<Any?, V> { | |
@Suppress("UNCHECKED_CAST") | |
override fun getValue(thisRef: Any?, property: KProperty<*>): V = props[key]!! as V | |
override fun setValue(thisRef: Any?, property: KProperty<*>, value: V) { | |
props[key] = value |
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.nio.ByteBuffer | |
import java.util.UUID | |
fun UUID.asBytes(): ByteArray { | |
val b = ByteBuffer.wrap(ByteArray(16)) | |
b.putLong(mostSignificantBits) | |
b.putLong(leastSignificantBits) | |
return b.array() | |
} |
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
swagger: 2.0 | |
info: | |
title: Clash Royale API | |
description: | |
version: v1 | |
termsOfService: http://supercell.com/en/terms-of-service/ | |
host: api.clashroyale.com | |
basePath: /v1 |
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
// https://hadoop.apache.org/docs/r2.7.5/hadoop-yarn/hadoop-yarn-common/yarn-default.xml | |
function generateInterface() { | |
return ['export interface IYarnClientConfig {', | |
$x('/html/body/table/tbody/tr/td[1]/a').flatMap(function(a) { | |
return [' /**', | |
' * '+a.parentElement.parentElement.children[2].innerText, | |
' */', | |
" '" + a.innerHTML + "'?: string", | |
''] | |
}).join("\n"), |