๐ฏ
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
# In the server, (images what I mostly used) | |
docker pull nvidia/cuda:11.1.1-cudnn8-devel-ubuntu20.04 | |
# cuda 10.0 multiple ports volume binding | |
docker run -ti --runtime=nvidia --name dongkwan -p 8082:22 -p 8083:6006 --ipc=host -v /mnt/nas2:/mnt/nas2 -d nvidia/cuda:11.1.1-cudnn8-devel-ubuntu20.04 /bin/bash | |
# Unknown runtime specified nvidia | |
docker run -ti --gpus '"device=0,1,2,3"' --name dongkwan -p 8070:22 --ipc=host -d nvidia/cuda:10.0-cudnn7-devel-ubuntu16.04 /bin/bash | |
# For volume | |
docker volume create volume_name |
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
$(function(){ | |
$(".textarea").off("keyup"); | |
$('.textarea').keyup(function () { | |
// ์ ๋ ฅํ ๊ฐ์ ๊ตฌํฉ๋๋ค. | |
var input = $(this).val(); | |
// ๋จ์ ๊ธ์ ์๋ฅผ ๊ตฌํฉ๋๋ค. | |
var inputlength = $(this).val().length; | |
// ๋ฌธ์ ๊ฐ์ฒด์ ์ ๋ ฅํฉ๋๋ค. | |
$('.length').html(inputlength); | |
}); |
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
function getArray(s) { | |
var arr = s.split(/(\s+)/).filter((e) => { | |
return e.trim().length > 0; | |
}); | |
return arr; | |
} |
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
from selenium import webdriver | |
from time import sleep | |
import csv | |
def run_driver(path): | |
driver = webdriver.Chrome(path) | |
driver.implicitly_wait(3) | |
return driver | |
def get_site(driver, url): |
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 math | |
ordinal = lambda n: "%d%s" % (n,"tsnrhtdd"[(math.floor(n/10)%10!=1)*(n%10<4)*n%10::4]) | |
# source: https://stackoverflow.com/questions/9647202/ordinal-numbers-replacement |
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
xargs -a requirements.txt -n 1 pip3 install |
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 random, sys | |
""" | |
๊ธฐ์ฐจ์ 100๋ช ์ ์น๊ฐ์ด ์์๋๋ก ํ๋ค. ์ฒซ ๋ฒ์งธ ์น๊ฐ์ด ํฐ์ผ์ ์์ด ๋ฒ๋ ค์ ๋๋คํ | |
์๋ฆฌ์ ์๋๋ค. ๋ ๋ฒ์งธ ์น๊ฐ๋ถํฐ๋ ์๊ธฐ ์๋ฆฌ๊ฐ ๋น์ด์์ผ๋ฉด ์๊ธฐ ์๋ฆฌ์ ์๊ณ , ๋๊ฐ | |
์์์์ผ๋ฉด ๋๋คํ ์๋ฆฌ์ ์๋๋ค. 100๋ฒ์งธ ์น๊ฐ์ด ์๊ธฐ ์๋ฆฌ์ ์์ ํ๋ฅ ์? | |
""" | |
def run(num): | |
passengers = list(range(1, num+1)) |
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
function moveVote(idx) | |
{ | |
var voted = 'url(//ton.twimg.com/tfw/assets/checkmark_circle_v1_06f15f494d711c69b89c759b68d1fcbbecdca631.svg)'; | |
for(var i = 1; i <= 4; i += 1) | |
$('.PollXChoice-choice--selected[data-poll-index="' + i + '"]').style.backgroundImage = "None"; | |
$('.PollXChoice-choice--selected[data-poll-index="' + idx + '"]').style.backgroundImage = voted; | |
} | |
moveVote(2); |
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
#! /bin/bash | |
# usage bash toCamel.sh target.js | |
# snake_func -> snakeFunc | |
for i in $(seq 1 30) | |
do | |
cat $1 | sed -r 's/([a-z]+)_([a-z])([a-z]+)/\1\U\2\L\3/g' > temp | |
mv temp $1 | |
done |
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
for(var i = 0; i < 10; i ++){ | |
var x = Math.floor((Math.random() * 80) + 1); | |
$("div[data="+x+"]").click(); | |
}; | |
$("#submit").click(); |