Skip to content

Instantly share code, notes, and snippets.


Ray Luo rayluo

View GitHub Profile
althonos / setup.cfg
Last active Nov 25, 2020
A `setup.cfg` template for my Python projects
View setup.cfg
name = {name}
version = file: {name}/_version.txt
author = Martin Larralde
author-email =
home-page ={name}
description = {description}
long-description = file:
diewland / n10_hdmi_resolution.txt
Created Jun 16, 2016
Nexus 10 change resolution script for fix hdmi problem
View n10_hdmi_resolution.txt
# ----------------
# (require root)
# reset
wm size reset
wm density reset
wm overscan reset
erikbern /
Last active Nov 17, 2020
How to use a .pfx file with Python requests – also works with .p12 files
import contextlib
import OpenSSL.crypto
import os
import requests
import ssl
import tempfile
def pfx_to_pem(pfx_path, pfx_password):
''' Decrypts the .pfx file to be used with requests. '''
jpf /
Last active Oct 26, 2020
JWTs signed with RS256 in Python: A demonstration of org-babel


This is a guide to using pyjwt to sign and validate a JWT using RS256.

The trickiest part of doing this is knowing what the proper OpenSSL commands are to generate the RSA keypair. I demonstrate that below.

Generating RSA keys

iMilnb /
Last active Oct 16, 2020
Programmatically manipulate AWS resources with boto3 - a quick hands on

boto3 quick hands-on

This documentation aims at being a quick-straight-to-the-point-hands-on AWS resources manipulation with [boto3][0].

First of all, you'll need to install [boto3][0]. Installing it along with [awscli][1] is probably a good idea as

  • [awscli][1] is boto-based
  • [awscli][1] usage is really close to boto's
JamesMGreene /
Last active Nov 25, 2020
A comparison of using `git flow` commands versus raw `git` commands.


gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

gitaarik /
Last active Nov 27, 2020
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.
dupuy / README.rst
Last active Oct 25, 2020
Common markup for Markdown and reStructuredText
View README.rst

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.

brianhsu /
Created Nov 30, 2011
[Python] reStructuredText GitHub Gist directive.
class GitHubGist(Directive):
""" Embed GitHub Gist.
.. gist:: GIST_ID
required_arguments = 1
optional_arguments = 1
You can’t perform that action at this time.