Skip to content

Instantly share code, notes, and snippets.

View neoneo40's full-sized avatar

neo neoneo40

  • Seoul, Korea
View GitHub Profile
import time
class PageCategoryFilter(object):
def __init__(self, config):
self.mode = config["mode"]
self.categories = config["categories"]
def filter(self, bid_request):
if self.mode == "whitelist":
@iMilnb
iMilnb / ec2.py
Created May 27, 2015 12:29
AWS EC2 simple manipulation script using python and boto3
#!/usr/bin/env python
# Simple [boto3](https://github.com/boto/boto3) based EC2 manipulation tool
#
# To start an instance, create a yaml file with the following format:
#
# frankfurt:
# - subnet-azb:
# - type: t2.micro
# image: image-tagname
@ccstone
ccstone / References For Learning & Using Applescript.md
Last active April 14, 2025 10:57
References For Learning & Using Applescript

REFERENCES FOR LEARNING & USING APPLESCRIPT Modified: 2018/06/19 18:47


NOTES

AppleScript is a rather peculiar scripting language to learn.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@allanlewis
allanlewis / pytest_newline_before_output.py
Last active October 19, 2018 19:25
A Pytest fixture that prints a newline before any other output when running with `-s` (`--capture=no`)
@pytest.yield_fixture(autouse=True)
def newline_before_logging(request):
if request.config.getoption('capture') == 'no':
print() # new-line
yield
@dvm-shlee
dvm-shlee / pykoen.py
Last active April 21, 2022 10:19
pykoen, jupyter notebook 을 이용한 interactive 한영번역기 (구글번역기 + Ginger 문법교정기)
from __future__ import absolute_import
import json
import sys
import re
import requests
import urllib
import urlparse
from urllib2 import HTTPError
from urllib2 import URLError
from urllib2 import urlopen
@duhaime
duhaime / measure_img_similarity.py
Last active September 10, 2024 20:14
Compare image similarity in Python using Structural Similarity, Pixel Comparisons, Wasserstein Distance (Earth Mover's Distance), and SIFT
import warnings
from skimage.measure import compare_ssim
from skimage.transform import resize
from scipy.stats import wasserstein_distance
from scipy.misc import imsave
from scipy.ndimage import imread
import numpy as np
import cv2
##
@daaniam
daaniam / ruff_pycharm_file_watcher.md
Last active January 4, 2025 14:17
ruff pycharm file watcher

Ruff file watchers in PyCharm + basic commands

Format code file watcher:

Name: ruff-format
Program: $PyInterpreterDirectory$/ruff
Arguments: format .
Working directory: $ProjectFileDir$