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
// https://www.jetbrains.com/help/idea/data-extractors.html | |
// https://www.jetbrains.com/help/datagrip/data-extractors.html | |
/* | |
* Available context bindings: | |
* COLUMNS List<DataColumn> | |
* ROWS Iterable<DataRow> | |
* OUT { append() } | |
* FORMATTER { format(row, col); formatValue(Object, col); getTypeName(Object, col); isStringLiteral(Object, col); } | |
* TRANSPOSED Boolean |
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 object_partial = < | |
P, | |
R, | |
PP = Partial<P>, | |
OP = Omit<P, keyof PP>, | |
>( | |
f: (p: P) => R, | |
pp: PP, | |
): ((op: OP) => R) => | |
(op: OP): R => f({ ...pp, ...op } as any) // Is it possible to omit `any`? |
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
#!/usr/bin/env bash | |
# Usage: source ./kube-use-context.sh <CONTEXT_NAME> | |
BASEDIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: ${BASH_SOURCE[0]} <CONTEXT_NAME>" | |
return |
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
#!/usr/bin/env bash | |
set -e | |
# | |
# Usage Example: ./k8s_configmap_cas.sh -n namespace configmap-name '{"key":"value1"}' '{"key":"value2"}' | |
# | |
NAMESPACE= | |
while getopts n: o; do | |
case $o in |
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
@ECHO OFF | |
SETLOCAL | |
SET BRANCH_NAME=%1 | |
SET COMMIT_HASH=%2 | |
SET REMOTE=%3 | |
@ECHO ON | |
git branch -f %BRANCH_NAME% %COMMIT_HASH% |
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
interface Flying { | |
fly(): this; | |
isFlying: () => boolean; | |
land(): this; | |
} | |
const flying = <O>(o: O) : O & Flying => { | |
let isFlying = false; | |
return Object.assign({}, o, { | |
fly() { |
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
{-# LANGUAGE OverloadedStrings #-} | |
import Data.Conduit | |
import Data.Conduit.Network | |
main :: IO () | |
main = runTCPServer (serverSettings 3001 "127.0.0.1") echo | |
echo :: AppData -> IO () | |
echo app = appSource app $$ appSink app |
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
require('net').createServer(s => s.on('data', s.write)).listen(4243); |
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
module Main where | |
import Control.Concurrent | |
import Control.Exception | |
import Control.Monad (when) | |
import Control.Monad.Fix (fix) | |
import Network.Socket | |
import System.IO | |
main :: IO () |
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
$(& hindent; $HindentExitCode=$LastExitCode) | stylish-haskell | |
$Host.SetShouldExit($HindentExitCode -Or $LastExitCode) |
NewerOlder