Skip to content

Instantly share code, notes, and snippets.

View data_master.yml
FL1-Z1-A01-001-01:
SC-RD-S: 1
FL1-Z1-A01-002-01:
SC-BK-S: 1
FL1-Z1-A01-003-01:
SC-BK-L: 2
FL1-Z1-A01-004-01:
SC-RD-M: 2
FL1-Z1-A01-005-01:
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
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
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 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/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
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
<?php
/**
* Show next payment date under 'Expiration' field in PMPro account page.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Works for PayPal Express and Stripe payment gateways.
* www.paidmembershipspro.com
*/
// 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
inchoate / including_external_package_in_dataflow.md
Last active Aug 20, 2019
Adding an extra package to a Python Dataflow project to run on GCP
View including_external_package_in_dataflow.md

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 setup.py.

Preparing the External Package

Your external package must have a proper setup.py. What follow is an example setup.py 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
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
CHEF-KOCH / dl_2015.txt
Last active Aug 20, 2019
Visual Studio 2019 Keys
View dl_2015.txt
Community:
http://download.microsoft.com/download/0/B/C/0BC321A4-013F-479C-84E6-4A2F90B11269/vs2015.com_enu.iso
Enterprise:
http://download.microsoft.com/download/6/4/7/647EC5B1-68BE-445E-B137-916A0AE51304/vs2015.ent_enu.iso
Professional:
http://download.microsoft.com/download/5/8/9/589A8843-BA4D-4E63-BCB2-B2380E5556FD/vs2015.pro_enu.iso
@unnamedd
unnamedd / apns.sh
Last active Aug 20, 2019 — forked from greencoder/apns.sh
cURL the APNS HTTP/2 API
View apns.sh
# 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> \
https://api.development.push.apple.com/3/device/<device token>
You can’t perform that action at this time.