Skip to content

Instantly share code, notes, and snippets.

@min-ki
min-ki / selenium.py
Last active August 25, 2019 01:07
Selenium with BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.alert import Alert
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException, UnexpectedAlertPresentException
from bs4 import BeautifulSoup
import time
from datetime import datetime
from pyvirtualdisplay import Display
def parser(id, pw):
@min-ki
min-ki / media-query.css
Last active August 25, 2019 01:06 — forked from gokulkrishh/media-query.css
CSS Media Query
// vim: syntax=css
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@min-ki
min-ki / remove_duplication.js
Last active March 12, 2020 05:57
객체로 이루어진 배열에서 특정 필드에 대해서 중복된 값을 제거
const array = [
{ id: 3, name: 'Central Microscopy', fiscalYear: 2018 },
{ id: 5, name: 'Crystallography Facility', fiscalYear: 2018 },
{ id: 3, name: 'Central Microscopy', fiscalYear: 2017 },
{ id: 5, name: 'Crystallography Facility', fiscalYear: 2017 }
];
const result = [];
const map = new Map();
for (const item of array) {
if(!map.has(item.id)){
@min-ki
min-ki / how-to-copy-aws-rds-to-local.md
Created August 6, 2020 00:52 — forked from syafiqfaiz/how-to-copy-aws-rds-to-local.md
How to copy production database on AWS RDS(postgresql) to local development database.
  1. Change your database RDS instance security group to allow your machine to access it.
    • Add your ip to the security group to acces the instance via Postgres.
  2. Make a copy of the database using pg_dump
    • $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    • you will be asked for postgressql password.
    • a dump file(.sql) will be created
  3. Restore that dump file to your local database.
    • but you might need to drop the database and create it first
    • $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
  • the database is restored