Skip to content

Instantly share code, notes, and snippets.

View data_master.yml
SC-RD-S: 1
SC-BK-S: 1
SC-BK-L: 2
SC-RD-M: 2
SC-BK-M: 2
View DispatchTime.swift
public extension Int {
public var seconds: DispatchTimeInterval {
return DispatchTimeInterval.seconds(self)
public var second: DispatchTimeInterval {
return seconds
narankhetani / postgres.docker.backup.txt
Last active Aug 20, 2019
How to backup a AWX postgres database in docker.
View postgres.docker.backup.txt
To backup:
docker exec -u <your_postgres_user> <postgres_container_name> pg_dump -Fc <database_name_here> > db.dump
To drop db (Don't do it on production, for test purpose only!!!):
docker exec -u <your_postgres_user> <postgres_container_name> psql -c 'DROP DATABASE <your_db_name>'
To restore:
docker exec -i -u <your_postgres_user> <postgres_container_name> pg_restore -C -d postgres < db.dump
working example for awx postgres database
aparrish / understanding-word-vectors.ipynb
Last active Aug 20, 2019
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0, other text released under CC BY 4.0
View understanding-word-vectors.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
andrewlimaza / next_payment_date_account.php
Last active Aug 20, 2019
Show next payment date under the 'Expiration' field in the PMPro Account Page
View next_payment_date_account.php
* Show next payment date under 'Expiration' field in PMPro account page.
* Add this code to your PMPro Customizations Plugin -
* Works for PayPal Express and Stripe payment gateways.
// Change the expiration text to show the next payment date instead of the expiration date
// This hook is setup in the wp_renewal_dates_setup function below
function my_pmpro_expiration_text($expiration_text) {
inchoate /
Last active Aug 20, 2019
Adding an extra package to a Python Dataflow project to run on GCP

The Problem

The documentation for how to deploy a pipeline with extra, non-PyPi, pure Python packages on GCP is missing some detail. This gist shows how to package and deploy an external pure-Python, non-PyPi dependency to a managed dataflow pipeline on GCP.

TL;DR: You external package needs to be a python (source/binary) distro properly packaged and shipped alongside your pipeline. It is not enough to only specify a tar file with a

Preparing the External Package

Your external package must have a proper What follow is an example for our ETL package. This is used to package version 1.1.1 of the etl library. The library requires 3 native PyPi packages to run. These are specified in the install_requires field. This package also ships with custom external JSON data, declared in the package_data section. Last, the setuptools.find_packages function searches for all available packages and returns that

bftanase / secure_link.php
Last active Aug 20, 2019
generate URL for nginx secure_link
View secure_link.php
View ipatch_decode.c
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#define ARRAYSIZE(x) (sizeof(x) / sizeof(*x))
#define FUSE_IMAGE_SIZE 0x400
#define ROM_BASE 0x100000
CHEF-KOCH / dl_2015.txt
Last active Aug 20, 2019
Visual Studio 2019 Keys
View dl_2015.txt
unnamedd /
Last active Aug 20, 2019 — forked from greencoder/
# Note: You MUST have curl 7.47+ with http/2 support compiled in
curl -v \
-d '{"aps":{"alert":"<message>","badge":42}}' \
-H "apns-topic: <bundle id>" \
-H "apns-priority: 10" \
--http2 \
--cert <certificate file> \<device token>
You can’t perform that action at this time.