$ docker run --rm -p 2181:2181 -p 9092:9092 --env ADVERTISED_HOST=localhost --env ADVERTISED_PORT=9092 spotify/kafka
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
export HISTCONTROL="ignoredups" | |
_peco_select_history() { | |
local l=$(HISTTIMEFORMAT= history | tac | sed -e 's/^\s*[0-9]*\+\s\+//' | peco --query "$READLINE_LINE") | |
READLINE_LINE="$l" | |
READLINE_POINT=${#l} | |
} | |
bind -x '"\C-r":_peco_select_history' |
Using Terraform docker
- Set up
~/.aws/credentials
- Install
awscli
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
from decimal import Decimal | |
import numbers | |
import unittest | |
def is_divisible(num, divisor): | |
assert isinstance(num, numbers.Number) | |
assert isinstance(divisor, numbers.Number) | |
quotient = Decimal(str(num)) / Decimal(str(divisor)) |
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
function getCustomProperty(name: string): string { | |
const style = window.getComputedStyle(document.documentElement); | |
return style.getPropertyValue(name).trim(); | |
} |
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
server { | |
listen 80 default_server; | |
# real_ip_header X-Forwarded-For | |
# server_name localhost; | |
location ~ ^/graphql(.*) { | |
# see https://stackoverflow.com/questions/35744650/docker-network-nginx-resolver | |
resolver 127.0.0.11 ipv6=off; | |
set $target http://${SOME_HOST}:${SOME_PORT}/graphql; |
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
#!/bin/bash -eu | |
exist_arg1() { | |
local EXIST_ARG1=false | |
if [ "$1" ]; then | |
local EXIST_ARG1=true | |
fi | |
echo ${EXIST_ARG1} | |
} |
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 assert = require("assert"); | |
const fs = require("fs"); | |
const path = require("path"); | |
function findFilesRecursively(pathToDir) { | |
assert(typeof pathToDir === "string"); | |
return fs.readdirSync(pathToDir).map(filename => { | |
const fullpath = path.join(pathToDir, filename); | |
if (isFile(fullpath)) { |
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
# -*- coding: utf-8 -*- | |
def main(): | |
print("Hello Python3") | |
if __name__ == '__main__': | |
main() |
hoge
foo