Skip to content

Instantly share code, notes, and snippets.

View Swalloow's full-sized avatar
🎯
Focusing

Junyoung Park Swalloow

🎯
Focusing
View GitHub Profile
@Swalloow
Swalloow / settings
Created October 5, 2019 13:17
aws cli settings
[test]
aws_access_key_id = mykey
aws_secret_access_key = mykey
[dev-default]
aws_access_key_id = mykey
aws_secret_access_key = mykey
[prod-default]
aws_access_key_id = mykey
@Swalloow
Swalloow / awsp.sh
Last active October 5, 2019 13:16
aws cli settings
#! /bin/bash
setProfile() {
export AWS_PROFILE=$1
export AWS_DEFAULT_PROFILE=$1
python ~/.aws/mfa.py --profile $1 $2
}
alias awsp=setProfile
{
"editor.tabSize": 4,
"editor.detectIndentation": true,
"editor.formatOnSave": true,
"editor.fontFamily": "D2Coding, Menlo, Monaco, 'Courier New', monospace",
"workbench.startupEditor": "welcomePage",
"terminal.integrated.rendererType": "dom",
"terminal.external.osxExec": "iTerm2",
"terminal.integrated.fontFamily": "D2Coding",
"terminal.integrated.shell.linux": "/bin/zsh",
#!/bin/bash
mkdir ~/Documents/Notebook
mkdir ~/Documents/GitHub
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install git
# install oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
name=s3-sink
connector.class=io.confluent.connect.s3.S3SinkConnector
tasks.max=1
topics=my-topic-name
s3.region=ap-northeast-2
s3.bucket.name=my-bucket-name
s3.compression.type=gzip
s3.part.size=5242880
flush.size=3
storage.class=io.confluent.connect.s3.storage.S3Storage
# Kafka broker IP addresses to connect to
bootstrap.servers=localhost:9092
# Path to directory containing the connector jar and dependencies
plugin.path=/home/ec2-user/kafka/plugins
# Converters to use to convert keys and values
key.converter=org.apache.kafka.connect.storage.StringConverter
value.converter=org.apache.kafka.connect.storage.StringConverter
@Swalloow
Swalloow / classInit.ts
Created July 10, 2018 12:28
Typescript Partial<T>
class Person {
public name: string = "default"
public address: string = "default"
public age: number = 0;
public constructor(init?:Partial<Person>) {
Object.assign(this, init);
}
}
@Swalloow
Swalloow / dynamo_delete_all.py
Created May 18, 2018 06:38
Boto3 DynamoDB delete all items
import boto3
dynamodb = boto3.resource('dynamodb', 'region-name')
table = dynamodb.Table('table-name')
scan = table.scan(
ProjectionExpression='#k',
ExpressionAttributeNames={
'#k': 'name'
}
import functools
def define_scope(function):
attribute = '_cache_' + function.__name__
@property
@functools.wraps(function)
def decorator(self):
if not hasattr(self, attribute):
with tf.variable_scope(function.__name):
class Model:
def __init__(self, data, target):
self.data = data
self.target = target
self.prediction
self.optimize
self.error
@lazy_property