PayPal uses various prefixes to distinguish different types of unique IDs in their APIs, but these are not currently documented in a single place. This Gist seeks to bring that information together into a single place. If there is something missing, please reach out through one of the channels on my GitHub profile since GitHub doesn't send notifications on Gist comments.
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
from collections import OrderedDict | |
from time import time | |
class Timer(object): | |
""" | |
Measure the time taken by some Python code, incl. its subtasks: | |
>>> with Timer('parent') as timer: | |
... sleep(0.5) | |
... with timer.child('child') as child: |
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 jwt | |
import requests | |
from time import time | |
pem_file = '/path/to/github.pem' # the absolute path to your Application Pem Certificate issued by GitHub | |
integration_id = 0 # GitHub Application Integration ID | |
installation_id = 0 # once installed on an organization. The Organization Integration ID | |
expire_seconds = 500 # number of seconds the jwt token expires (max ~600 but not designated by GitHub) | |
slug = 'owner/repo' # name of repo for demo purposes |
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
!define APPNAME "App Name" | |
!define COMPANYNAME "Company Name" | |
!define DESCRIPTION "A short description goes here" | |
# These three must be integers | |
!define VERSIONMAJOR 1 | |
!define VERSIONMINOR 1 | |
!define VERSIONBUILD 1 | |
# These will be displayed by the "Click here for support information" link in "Add/Remove Programs" | |
# It is possible to use "mailto:" links in here to open the email client | |
!define HELPURL "http://..." # "Support Information" link |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from contextlib import contextmanager | |
import ctypes | |
import ctypes.util | |
from ctypes import CFUNCTYPE | |
objc = ctypes.cdll.LoadLibrary(ctypes.util.find_library('objc')) |
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 cProfile | |
import pstats | |
from io import StringIO | |
import logging | |
import os | |
import time | |
PROFILE_LIMIT = int(os.environ.get("PROFILE_LIMIT", 30)) | |
PROFILER = bool(int(os.environ.get("PROFILER", 1))) |
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
!include nsDialogs.nsh | |
!include LogicLib.nsh | |
!include MUI2.nsh | |
Name nsDialogs | |
OutFile nsDialogs.exe | |
RequestExecutionLevel user | |
ShowInstDetails show | |
Var Dialog |
Last revised on [DATE]
[COMPANY] operates the [SERVICE] service, which we hope you use. If you use it, please use it responsibly. If you don't, we'll have to terminate your account.
For paid accounts, you'll be charged on a monthly basis. You can cancel anytime, but there are no refunds.
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
# How to sign your custom RPM package with GPG key | |
# Step: 1 | |
# Generate gpg key pair (public key and private key) | |
# | |
# You will be prompted with a series of questions about encryption. | |
# Simply select the default values presented. You will also be asked | |
# to create a Real Name, Email Address and Comment (comment optional). | |
# | |
# If you get the following response: |
Custom format for displaying bytes as kb
, mb
, gb
or tb
.
Response to a few places on the internet: https://productforums.google.com/forum/#!topic/docs/x_T_N-yRUYg And here: https://stackoverflow.com/questions/1533811/how-can-i-format-bytes-a-cell-in-excel-as-kb-mb-gb-etc
Here is one that I have been using:
[<1000000]0.00," KB";[<1000000000]0.00,," MB";0.00,,," GB"
OlderNewer