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 openjdk:9-jre AS build | |
## Deps to install DynamoDB | |
RUN apt-get update \ | |
&& apt-get install -y --no-install-recommends \ | |
coreutils \ | |
ca-certificates \ | |
&& mkdir -p /dynamodb/data | |
WORKDIR /dynamodb |
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 BeautifulSoup import BeautifulSoup as Soup | |
from urllib2 import urlopen | |
def get_product_links(url): | |
try: | |
content = urlopen(url).read() | |
except: | |
return False | |
soup = Soup(content) | |
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
<?php | |
/* | |
Plugin Name: Custom-Post-Type Base | |
Plugin URI: http://pmg.co/ | |
Description: Dynamically change your custom post type slugs | |
Version: n/a | |
Author: Christopher Davis | |
Author URI: http://pmg.co/people/chris | |
License: GPL2/Creative Commons | |
*/ |
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
http { | |
# other stuff here | |
# The upstream backend server this can be named whatever you desire | |
# See http://nginx.org/en/docs/http/ngx_http_upstream_module.html | |
upstream backend { | |
# this is the actual hostname + port of the backend server | |
server backend:8080; | |
# how many keep alive connections to allow, only set this if you're going | |
# to specify the `Connection` header in the proxy below, nginx sets the |
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 argparse | |
import os | |
import smtplib | |
from email import Encoders | |
from email.MIMEMultipart import MIMEMultipart | |
from email.MIMEBase import MIMEBase | |
from email.Utils import formatdate | |
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
<?php | |
/** | |
* an example of how to read huge XML files relatively quickly and efficiently | |
* using a few core PHP libraries. | |
* | |
*/ | |
// Assume your file is very large, 140MB or somethig like that | |
$fn = __DIR__ . '/some_file.xml'; |
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
<?php | |
/* | |
Plugin Name: Remove All Feeds [for WPSE33072] | |
Description: Remove all feeds from WordPress | |
Author: Christopher Davis | |
Author URI: http://christopherdavis.me | |
License: GPL2 | |
*/ | |
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
<?php | |
/* | |
Plugin Name: Mask Outbound Links | |
Plugin URI: http://www.christopherguitar.net/ | |
Description: Masks outbound links behind a redirect | |
Author: Christopher Davis | |
Author URI: http://www.christopherguitar.net/ | |
License: GPL2 | |
*/ |
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
<?php | |
/** | |
* Copyright (c) 2016 PMG <https://www.pmg.com> | |
* | |
* License: MIT | |
*/ | |
use Symfony\Component\PropertyAccess\PropertyAccess; | |
use Symfony\Component\PropertyAccess\PropertyAccessorInterface; | |
use Symfony\Component\Form\FormEvents; |