Skip to content

Instantly share code, notes, and snippets.

View 1ambda's full-sized avatar
๐Ÿฆ
in the jungle

Kun 1ambda

๐Ÿฆ
in the jungle
View GitHub Profile
dfConverted3 = dfConverted1\
.selectExpr("*",
f"CASE WHEN education == '{educationInvalid}' THEN '{educationDefault}' ELSE education END as education"
)
@leoh0
leoh0 / README.md
Last active July 18, 2024 06:44
containerd๋ฅผ ์ด์šฉํ•ด์„œ standalone kubelet ์‚ฌ์šฉํ•˜๊ธฐ

standalone-kubelet-with-containerd.md

๊ฐ€๋” kubernetes ๊ฐ™์€๊ฑด ๋„ˆ๋ฌด ๋ฌด๊ฑฐ์›Œ์„œ ๋‹จ์ผ ํ˜ธ์ŠคํŠธ์— docker๋งŒ ๋„์›Œ์„œ ์šด์˜ํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ™์€๊ฑธ ๊ณ ๋ฏผ ํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ๊ทธ๋ƒฅ docker๋งŒ ๊ฐ€์ง€๊ณ  ์‚ฌ์šฉํ•˜๋ฉด ์ปจํ…Œ์ด๋„ˆ๊ฐ€ ์ฃฝ์—ˆ์„๋•Œ ๊ด€๋ฆฌํ•ด ์ค˜์•ผ ํ•˜๋Š” ๋ถˆํŽธํ•จ๊ณผ ๊ฐ™์ด ๊ธฐ๋Šฅ์„ ๋ณด๋‹ค ๋” ํ•„์š”๋กœ ํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ์ด ๋ฐฉ๋ฒ•์„ ์†Œ๊ฐœํ•ด ๋“œ๋ฆฝ๋‹ˆ๋‹ค.

์ด๊ฑด standalone kubelet ์ด๋ผ๊ณ  ๋ถˆ๋ฆฌ๋Š” master ์—†์ด node๋งŒ ๊ด€๋ฆฌํ•ด์ฃผ๋Š” kubelet์„ ์ด์šฉํ•ด์„œ container๋ฅผ ๊ด€๋ฆฌํ•˜๋Š” ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค. ์ด๊ฑด k8s ์ดˆ๊ธฐ ๋ถ€ํ„ฐ ์›๋ž˜ ์กด์žฌํ–ˆ๋˜ ์ปจ์…‰์ด๋‚˜ ๋งŽ์ด ์•Œ๋ ค์ ธ ์žˆ์ง€ ์•Š์•„์„œ ๋ชจ๋ฅด์‹œ๋Š” ๋ถ„๋“ค์ด ๋งŽ์•„์„œ ์ด๊ธ€์„ ์ž‘์„ฑํ•ด ๋ดค์Šต๋‹ˆ๋‹ค.

์ด ๋ฐฉ๋ฒ•์„ ์ด์šฉํ•˜๋ฉด ์‹ค์ œ master ์—†์ด kubelet ๋งŒ์œผ๋กœ ์„œ๋น„์Šค๋ฅผ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ปจํ…Œ์ด๋„ˆ ์ž๋™ ์žฌ์‹œ์ž‘, port forwarding, resource limit ๋“ฑ ๊ธฐ๋ณธ์ ์ธ kubelet์—์„œ ์ œ๊ณตํ•˜๋Š” ๋‹ค์–‘ํ•œ ๋ฐฉ๋ฒ•์œผ๋กœ ์ปจํ…Œ์ด๋„ˆ๋“ค์„ ๊ด€๋ฆฌ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

@wickedev
wickedev / SpringCoroutineApp.kt
Last active August 21, 2020 14:08
Spring Webflux + Kotlin Coroutine + Spring Data R2DBC
package com.spring.coroutine
import io.r2dbc.spi.ConnectionFactory
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
import org.springframework.context.support.beans
import org.springframework.core.io.ClassPathResource
import org.springframework.data.annotation.Id
import org.springframework.data.r2dbc.connectionfactory.init.CompositeDatabasePopulator
import org.springframework.data.r2dbc.connectionfactory.init.ConnectionFactoryInitializer
@slikts
slikts / context-vs-redux-2020.md
Last active March 6, 2022 20:41
Up to date answer about when to use React context or Redux (Redux Toolkit)

nelabs.dev

React context vs Redux in 2020

The [React docs][condoc] give some example use cases for context:

Context is designed to share data that can be considered โ€œglobalโ€ for a tree of React components, such as the current authenticated user, theme, or preferred language.

The common property of these use cases is that data like the current theme doesn't change often and needs to be shared deep down the component tree, which would be cumbersome with "[prop drilling][drill]". Something else that needs to be shared everywhere is the application state when using a "single source of truth" pattern, so it would follow that the context API would help with that as well, but there's a catch: components that use context will rerender every time that the provided value changes, so sharing the whole application state through context would cause excessive render lifecycles.

@yhatt
yhatt / marp.md
Last active July 20, 2024 18:52
Marp Next example
marp

Marp

h:250

Markdown presentation ecosystem
@ninanung
ninanung / ReactHooks1.md
Last active May 17, 2020 09:19
๋•Œ๋Šฆ์€ React Hooks ์‹œ๋ฆฌ์ฆˆ 1ํƒ„ - ๊ฐœ์š”/useState

์ด ๊ธ€์˜ ์ฝ”๋“œ๋Š” ์ €์ž์˜ Github์—์„œ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋•Œ๋Šฆ์€ React Hooks ์‹œ๋ฆฌ์ฆˆ 1ํƒ„ - ๊ฐœ์š”/useState

๋‚˜์˜จ์ง€๊ฐ€ ์–ธ์ œ์ธ๋ฐ ์ง€๊ธˆ์—์„œ์•ผ ์ด๊ฑธ...?

๊ทธ๊ฑด ์ œ๊ฐ€ ์ด์ œ์„œ์•ผ ์ด๊ฑธ ์•Œ์•˜๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค. ๋Šฆ๊ฒŒ๋ผ๋„ ์•Œ์•˜์œผ๋‹ˆ ์‹œ์ž‘ํ•ด์•ผ์ฃ  ๋ณ„์ˆ˜ ์žˆ๋‚˜์š”.

๊ฐœ์š”

@chendo
chendo / _document.js
Last active June 2, 2022 02:54
Server side rendering (SSR) in Next.js with styled-components, styled-jsx, and emotion.
import Document, { Head, Main, NextScript } from 'next/document'
import { renderToString } from 'react-dom/server'
import { extractCritical } from 'emotion-server'
import { ServerStyleSheet } from 'styled-components'
import flush from 'styled-jsx/server'
export default class MyDocument extends Document {
static async getInitialProps(ctx) {
const styledComponentsSheet = new ServerStyleSheet()
@SehoNoh
SehoNoh / fixed-aws-kinesis-agent-setup
Created January 15, 2019 12:55
Bugfix aws kinesis agent setup script
#! /usr/bin/env bash
# If we have an error, bail out!
set -e
# If we're debugging, be really loudly verbose
[[ ! -z $DEBUG ]] && set -x
# Attempt to load up the /etc/lsb-release file to determine our OS. If none is
# found, we default our settings to RHEL/Amazon Linux as the original behavior
@neerfri
neerfri / gist:4bd7477920cb33a2a229807ed10c29c2
Created September 6, 2018 08:32
k8s cluster autoscaler command line options
$ docker run k8s.gcr.io/cluster-autoscaler:v1.2.2 /cluster-autoscaler -h
Usage of /cluster-autoscaler:
pflag: help requested
--address string The address to expose prometheus metrics. (default ":8085")
--alsologtostderr log to standard error as well as files
--application-metrics-count-limit int Max number of application metrics to store (per container) (default 100)
--azure-container-registry-config string Path to the file containing Azure container registry configuration information.
--balance-similar-node-groups Detect similar node groups and balance the number of nodes between them
--boot-id-file string Comma-separated list of files to check for boot-id. Use the first one that exists. (default "/proc/sys/kernel/random/boot_id"
@whoisryosuke
whoisryosuke / nextjs-hoc-authorization.js
Created June 26, 2018 22:24
ReactJS - NextJS - A HOC for wrapping NextJS pages in an authentication check. Checks for getInitialProps on the child component and runs it, so you still get SSR from the page. Also includes a user agent for Material UI.
import React, {Component} from 'react'
import Router from 'next/router'
import AuthService from './AuthService'
export default function withAuth(AuthComponent) {
const Auth = new AuthService('http://localhost')
return class Authenticated extends Component {
static async getInitialProps(ctx) {
// Ensures material-ui renders the correct css prefixes server-side