Skip to content

Instantly share code, notes, and snippets.

View seunggabi's full-sized avatar
🎯
Focusing

Seunggabi Kim seunggabi

🎯
Focusing
View GitHub Profile
@seunggabi
seunggabi / scrollBottom.js
Created May 10, 2020 18:15
scrollBottom.js
window.scrollTo(0,document.body.scrollHeight);
@seunggabi
seunggabi / requestUrlFilter.java
Created May 2, 2020 09:01
[Spring] request url filter
@Configuration
public class FilterConfiguration {
@Bean
public FilterRegistrationBean<CountryFilter> perfFilter() {
FilterRegistrationBean<CountryFilter> registration = new FilterRegistrationBean<>();
registration.setFilter(new CountryFilter());
registration.addUrlPatterns("/*");
return registration;
@seunggabi
seunggabi / instagram_follower.py
Created March 31, 2020 04:59
instagram_follower.py
import requests
from bs4 import BeautifulSoup
import json
import sys
from datetime import datetime
# window._sharedData.entry_data.ProfilePage[0].graphql.user.edge_followed_by.count
try:
id = sys.argv[1]
except IndexError:
@seunggabi
seunggabi / mapToJson.java
Created March 21, 2020 11:48
mapToJson.java
public static String mapToJson(Map map, boolean isPretty) {
ObjectMapper mapper = new ObjectMapper();
try {
return isPretty ?
mapper.writerWithDefaultPrettyPrinter().writeValueAsString(map) :
mapper.writeValueAsString(map);
} catch (JsonProcessingException e) {
return "";
}
@seunggabi
seunggabi / copy.js
Last active March 17, 2020 15:43
copy.js
<style>
.blind {
overflow: hidden;
position: absolute;
clip: rect(0 0 0 0);
width: 1px;
height: 1px;
margin: -1px;
}
</style>
@seunggabi
seunggabi / download.js
Created March 5, 2020 14:28
download.js
function download(name, url) {
const save = document.createElement('a');
save.download = name;
save.href = url.replace(/https?:\/\//gi, '://');
save.target = '_blank';
document.body.appendChild(save);
save.click();
document.body.removeChild(save);
}
@seunggabi
seunggabi / print_access_log.sh
Created March 2, 2020 16:29
print_access_log.sh
#!/bin/sh
# ./print_access_log.sh keyword 20200302 server_list.txt
### server_list.txt ###
a
b
c
#######################
keyword=$1
@seunggabi
seunggabi / stringUtils.py
Created January 27, 2020 12:51
stringUtils.py
import re
class StringUtils:
@staticmethod
def removeTags(contents):
contents = re.sub("<\/?[\w\?\"\.\=\-\ ]*>", "", contents)
contents = re.sub("(\\n\\t*\\n)+", "\\n", contents)
return contents
@seunggabi
seunggabi / io.py
Created January 27, 2020 12:51
io.py
import time
import os
class IO:
def __init__(self, path, name):
if not os.path.exists(path):
os.makedirs(path)
self.path = path
@seunggabi
seunggabi / proxy.py
Last active January 27, 2020 12:43
proxy.py
# reference: https://wkdtjsgur100.github.io/selenium-change-ip/
# brew install geckodriver
# brew install tor
# brew services restart tor
from selenium import webdriver
from bs4 import BeautifulSoup
import os