Skip to content

Instantly share code, notes, and snippets.

View LeeHanYeong's full-sized avatar
🏠
Working from home

lhy LeeHanYeong

🏠
Working from home
View GitHub Profile
@LeeHanYeong
LeeHanYeong / adapter.py
Last active December 2, 2019 08:29
Social Login username
# users/social/adapter.py
from allauth.account.utils import user_username, user_email, user_field
from allauth.socialaccount.adapter import DefaultSocialAccountAdapter
from allauth.utils import valid_email_or_none
class SocialAdapter(DefaultSocialAccountAdapter):
def populate_user(self, request, sociallogin, data):
provider = sociallogin.account.provider
unique_id = sociallogin.account.extra_data['id']
var n = e.target,
t = n.closest("a"),
r = n.closest("img");
if (t || r) {
var o = {};
t && (o.link = t.href), r && (o.image = r.src), (o.link || o.image) && webkit.messageHandlers.webViewContextMenuHandler.postMessage(o)
}
@LeeHanYeong
LeeHanYeong / base64
Created July 5, 2019 07:55
Sample Base64 Image
/9j/4AAQSkZJRgABAQEARgBGAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUFBQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh7/wgARCAIVAyADAREAAhEBAxEB/8QAGwABAQADAQEBAAAAAAAAAAAAAAECAwQFBgf/xAAZAQEBAQEBAQAAAAAAAAAAAAAAAQIDBAX/2gAMAwEAAhADEAAAAf2UQoAAAIUAAAAAAAAAAEYYZ9AAAAAAAAAAAAAQAEABEAICEgYiIsSAxJEMSEMSRiYkMTEwlxMT6T0QAAAAIUAAAAAAAAAAEY5ZbAAAAAAAAAAAAAIACAAJAgICRCRAsIkISIYkIYxiQxMVxTFcTGPovRAAAAAAAAAAAAAAAABjhlsAAAAAAAAAAAAAEABAARAQEBIhIEWEImIjEhDEhjGJDExXBMY+h9AAAAAAAAAAAAAAAAAIUAAAAAAAAAAAAAAgABACICAhIEIIhiFxIkiEMSGMsTExMTFcI+g9EAAAACFAAAAAAAAAAAIUAAAAAAAAAAAAAAEABAARAQgJAhCRFGJEhIhiYkJLimJiYmJ73cAAAAAAAAAAAAAAAAEKAAAAAAAAAAAAAAAQAEACCICAkQEiLCESLEkYmJDEkYkMTA93uAAAAAAAAAAAAAAAACFAAAAAAAAAAAAAAAAIAQAiAgICRCQIsSEIQxiGJjEqRiYmB7fZQBQAQoAAAAAAAAAAAICgAAAAAAAAAAAAAAAgABACICEBBEJEIsBExJGJDFYmMQwMT2uygCghSAoAAAAAAAAAABAUAAAAAAAAAAAAAAAAEABAEgCEBBEJEIsSLEhjEMSGJjGJie13AAAAAAAAAAAAAAAAICgAAAAAAAAAAAAAAAAEAIAkAQEBIhBEWEIYkSRiYkMY
@LeeHanYeong
LeeHanYeong / eb-activity.log
Created July 1, 2019 07:49
EB Deploy에서 오래걸리는 부분
# 6분넘게 소요
[2019-07-01T07:24:41.454Z] INFO [2733] - [Application update app-2675-190701_162312-stage-190701_162312@7/AppDeployStage1/AppDeployEnactHook/01flip.sh] : Starting activity...
[2019-07-01T07:32:58.304Z] INFO [2733] - [Application update app-2675-190701_162312-stage-190701_162312@7/AppDeployStage1/AppDeployEnactHook/01flip.sh] : Completed activity. Result:
nginx: [warn] duplicate MIME type "text/html" in /etc/nginx/sites-enabled/elasticbeanstalk-nginx-docker-proxy.conf:11
Stopping nginx: [ OK ]
Starting nginx: nginx: [warn] duplicate MIME type "text/html" in /etc/nginx/sites-enabled/elasticbeanstalk-nginx-docker-proxy.conf:11
[ OK ]
cat: /var/app/current/Dockerrun.aws.json: No such file or directory
/opt/elasticbeanstalk/hooks/common.sh: line 98: [: 1: unary operator expected
iptables: Saving firewall rules to /etc/sysconfig/iptables: [ OK ]
@LeeHanYeong
LeeHanYeong / remove_old_kernel.sh
Created February 4, 2019 10:54
Linux remove old kernel
#!/bin/sh
prev=`readlink /vmlinuz.old` && prev=linux-image-${prev#*-}+
exec sudo apt-get -y purge '^linux-image-[0-9]' linux-image-`uname -r`+ $prev
@LeeHanYeong
LeeHanYeong / script.ahk
Created October 22, 2018 08:27
ScaleDown Script
global AppName := "LDPlayer"
global WindowWidth := 960
global WindowHeight := 720
FocusWindow() {
if (!WinExist(AppName)) {
MsgBox, "Start Emulator first"
return
}
WinActivate, %AppName%
@LeeHanYeong
LeeHanYeong / .gitignore
Last active October 18, 2017 20:05
Django - Instagram
# Custom
.idea/
# Config folder
.config_secret/
### Django ###
*.log
*.pot
*.pyc
@LeeHanYeong
LeeHanYeong / .gitignore
Last active November 20, 2021 16:21
Django .gitignore
# Custom
.idea/
# Config folder
.secrets/
### Django ###
*.log
*.pot
*.pyc
@LeeHanYeong
LeeHanYeong / .gitignore
Created June 18, 2017 07:48
.gitignore(macOS, Python, Pycharm, Django, Linux)
.idea/
# Created by https://www.gitignore.io/api/macos,linux,django,python,pycharm
### Django ###
*.log
*.pot
*.pyc
__pycache__/
local_settings.py
@LeeHanYeong
LeeHanYeong / .gitignore
Created June 17, 2017 08:34
Ruby, Jekyll, macOS gitignore
# Created by https://www.gitignore.io/api/ruby,macos,jekyll
### Jekyll ###
_site/
.sass-cache/
.jekyll-metadata
### macOS ###
*.DS_Store