- On Frontend
- User clicks
Login With Github
Button. - We redirect user to
https://github.com/login/oauth/authorize
withclient_id
,redirect_uri
andscope
as query params. - Example
https://github.com/login/oauth/authorize?scope=user:email&client_id=<CLIENT_ID>&state=<state>
- Once user allows access github redirect back us to supplied
redirect_uri
withcode
as query parameter. - Example
- User clicks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here is a list of scopes to use in Sublime Text 2 snippets - | |
ActionScript: source.actionscript.2 | |
AppleScript: source.applescript | |
ASP: source.asp | |
Batch FIle: source.dosbatch | |
C#: source.cs | |
C++: source.c++ | |
Clojure: source.clojure | |
CoffeeScript: source.coffee |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sign_data(private_key, hashed_data): | |
''' | |
param: private_key | |
param: hashed_data SHA256 hash of data to be signed | |
return: base64 encoded signature | |
''' | |
from Crypto.PublicKey import RSA | |
from Crypto.Signature import PKCS1_v1_5 | |
from base64 import b64encode | |
key = private_key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def verify_sign(public_key, signature, hashed_data): | |
''' | |
Verifies with a public key from whom the data came that it was indeed | |
signed by their private key | |
param: public_key | |
param: signature String signature to be verified | |
return: Boolean. True if the signature is valid; False otherwise. | |
''' | |
from Crypto.PublicKey import RSA | |
from Crypto.Signature import PKCS1_v1_5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generate_RSA(bits=2048): | |
''' | |
Generate an RSA keypair with an exponent of 65537 in PEM format | |
param: bits The key length in bits | |
Return private key and public key | |
''' | |
from Crypto.PublicKey import RSA | |
new_key = RSA.generate(bits, e=65537) | |
public_key = new_key.publickey().exportKey("PEM") | |
private_key = new_key.exportKey("PEM") |
Sidekiq jobs can be enqueued or scheduled. Enqueued means that they are gonna be picked up as soon as possible, scheduled jobs will be enqueued at some specific time.
When using ActiveJobs, Rails will return a job_id
after sending the job to ActiveJobs
job = UserMailer.send_invite(params).deliver_later
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, string | |
from xml.sax import saxutils, handler, make_parser | |
class ContentGenerator(handler.ContentHandler): | |
def __init__(self, out = sys.stdout): | |
handler.ContentHandler.__init__(self) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Title of Your Project [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Check%20out%20this%20cool%20project&url=https://github.com/Cool/Project&hashtags=project,opensource) | |
![Github License](https://img.shields.io/badge/license-MIT-green) | |
![Code Coverage](https://img.shields.io/badge/coverage-90%25-green) | |
![React Version](https://img.shields.io/badge/react-v16.12.0-blue.svg) | |
![example](https://mdn.mozillademos.org/files/10529/inspector.png) | |
#### Description of your project |
Get the metadata and content of all files in a selected GitHub repo, using GraphQL
You might want to get a tree summary of files in a repo without downloading the repo, or maybe you want to lookup the contents of a file again without download the whole repo.
The approach here is to query data from GitHub using the Github V4 GraphQL API.
OlderNewer