Skip to content

Instantly share code, notes, and snippets.

Shin Hyungjin jayuloy

Block or report user

Report or block jayuloy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@egoing
egoing / The OAuth 2.0 Authorization Framework: Bearer Token Usage.md
Last active Jun 25, 2019
Bearer Authentication 에 대해서 살펴봅니다.
View The OAuth 2.0 Authorization Framework: Bearer Token Usage.md

소개

이 글은 Oauth를 이용해서 access token을 획득한 후에 api에 접속하는 방법에 대해서 설명하고 있습니다.

우선 공부해야 할 것들

이 글은 WEB2 OAuth2 수업과 WEB2 HTTP 수업에 의존하고 있습니다. OAuth와 HTTP를 잘 모르신다면 이 수업들을 먼저 보시고 이 글을 볼 것을 권해드립니다.

Bearer Authentication란?

API에 접속하기 위해서는 access token을 API 서버에 제출해서 인증을 해야 합니다. 이 때 사용하는 인증 방법이 Bearer Authentication 입니다. 이 방법은 OAuth를 위해서 고안된 방법이고, RFC 6750에 표준명세서가 있습니다.

@michelp
michelp / postgrest-quick.sh
Last active Jun 22, 2018
From nothing to REST API with PostgREST
View postgrest-quick.sh
# Minimal example of getting a PostgREST API running from scratch for
# testing purposes. It uses docker to launch a postgres database and
# a postgrest api server.
# This should not be used to deploy a production system but to
# understand how postgrest works. In particular there is no security
# implemented, see the docs for more.
# https://postgrest.org/en/v4.4/
@LucasMagnum
LucasMagnum / queries.py
Created Aug 2, 2017
#DjangoTip - Playing with querysets - Print Queryset
View queries.py
print(adult_products.query)
"""
SELECT `product_product`.`title`, `product_product`.`is_adult`, `product_product`.`is_active`
FROM `product_product` WHERE `product_product`.`is_adult` = True
"""
print(active_products.query)
"""
SELECT `product_product`.`title`, `product_product`.`is_adult`, `product_product`.`is_active`
FROM `product_product` WHERE `product_product`.`is_active` = True
@mdamien
mdamien / 0readme.md
Last active Jun 8, 2019
404 link detector with scrapy
View 0readme.md

List all the broken links on your website

Requirements:

python3 and scrapy (pip install scrapy)

Usage

  • scrapy runspider -o items.csv -a site="https://yoursite.org" 1spider.py
  • python3 2format_results.py
View how-to-make-a-racist-ai-without-really-trying.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View steemit-helper.user.js
// ==UserScript==
// @name Steemit Helper
// @version 0.1.1
// @description Tag Autocompletion, more is coming.
// @author Heejin Lee <monster@teamappetizer.com>
// @updateURL https://gist.github.com/appetizermonster/0f95597f1ad71b1668bc44812502605c/raw/steemit-helper.user.js
// @downloadURL https://gist.github.com/appetizermonster/0f95597f1ad71b1668bc44812502605c/raw/steemit-helper.user.js
// @match https://steemit.com/*
// @include https://steemit.com/*/*
// @resource selectizeCss https://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.12.4/css/selectize.min.css
@aparrish
aparrish / spacy_intro.ipynb
Last active Jun 21, 2019
NLP Concepts with spaCy. Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
View spacy_intro.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Linux - Systemd cheatsheet.md

Linux - Systemd cheatsheet

systemctl

Activates a service immediately:

systemctl start foo.service

Deactivates a service immediately:

View auth.py
class MyUserAuthBackend(object):
def check_legacy_password(self, db_password, supplied_password):
return constant_time_compare('*'+ hashlib.sha1(hashlib.sha1(supplied_password.encode('utf-8')).digest()).hexdigest().upper(), db_password)
def authenticate(self, username=None, password=None):
""" Authenticate a user based on mb_id as the user name. """
try:
@allieus
allieus / Vagrantfile
Last active Feb 18, 2017
장고 개발을 위한 Vagrantfile
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
You can’t perform that action at this time.