Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Ray Luo rayluo

🎯
Focusing
View GitHub Profile
@brianhsu
brianhsu / gist.py
Created Nov 30, 2011
[Python] reStructuredText GitHub Gist directive.
View gist.py
class GitHubGist(Directive):
""" Embed GitHub Gist.
Usage:
.. gist:: GIST_ID
"""
required_arguments = 1
optional_arguments = 1
@diewland
diewland / n10_hdmi_resolution.txt
Created Jun 16, 2016
Nexus 10 change resolution script for fix hdmi problem
View n10_hdmi_resolution.txt
# ----------------
# http://forum.xda-developers.com/showthread.php?t=2278508
# http://forum.xda-developers.com/showthread.php?t=2294786
#
# (require root)
# reset
wm size reset
wm density reset
wm overscan reset
@tomdeboer
tomdeboer / for_me_on_github.html
Last active Apr 3, 2021 — forked from matthua/main.html
Show a "Fork me on Github" banner on the top right corner. With z-index.
View for_me_on_github.html
<a href="https://github.com/tomdeboer/imito"><img style="position: absolute; top: 0; right: 0; border: 0; z-index:100;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
@jpf
jpf / signed-jwt-in-python.md
Last active Oct 23, 2021
JWTs signed with RS256 in Python: A demonstration of org-babel
View signed-jwt-in-python.md

Introduction

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

@demaniak
demaniak / Dockerfile
Created Apr 24, 2020
Run Microsoft teams in docker on linux
View Dockerfile
FROM ubuntu
RUN apt-get update && \
apt-get install -y curl apt-utils \
libasound2 libatk-bridge2.0-0 libcairo2 libcups2 libgdk-pixbuf2.0-0 \
libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 \
libsecret-1-0 libx11-xcb1 libxcomposite1 libxcomposite1 \
libxss1 apt-transport-https libxkbfile1
COPY teams.deb /tmp/teams.deb
@gene1wood
gene1wood / analyze_pypi_package_names.py
Last active Jun 17, 2022
Analysis of PyPi package names and the use of dashes underscores upper and lower case
View analyze_pypi_package_names.py
try:
import xmlrpclib
except ImportError:
import xmlrpc.client as xmlrpclib
client = xmlrpclib.ServerProxy('https://pypi.python.org/pypi')
packages = client.list_packages()
total = len(packages)
dashes = len([x for x in packages if '-' in x])
@erikbern
erikbern / use_pfx_with_requests.py
Last active Sep 6, 2022
How to use a .pfx file with Python requests – also works with .p12 files
View use_pfx_with_requests.py
import contextlib
import OpenSSL.crypto
import os
import requests
import ssl
import tempfile
@contextlib.contextmanager
def pfx_to_pem(pfx_path, pfx_password):
''' Decrypts the .pfx file to be used with requests. '''
@dupuy
dupuy / README.rst
Last active Oct 1, 2022
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.

@iMilnb
iMilnb / boto3_hands_on.md
Last active Oct 19, 2022
Programmatically manipulate AWS resources with boto3 - a quick hands on
View boto3_hands_on.md

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
@althonos
althonos / setup.cfg
Last active Nov 28, 2022
A `setup.cfg` template for my Python projects
View setup.cfg
# https://gist.github.com/althonos/6914b896789d3f2078d1e6237642c35c
[metadata]
name = {name}
version = file: {name}/_version.txt
author = Martin Larralde
author_email = martin.larralde@embl.de
url = https://github.com/althonos/{name}
description = {description}
long_description = file: README.md