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 re | |
>>> data = """1foo bar | |
... 2bing baz | |
... 3spam eggs | |
... nomatch | |
... """ | |
>>> pattern = r"(.)(\w+)\s(\w+)" | |
>>> {x[0]: x[1] for x in (m.group(3, 2) for m in (re.search(pattern, line) for line in data.splitlines()) if m)} | |
{'baz': 'bing', 'eggs': 'spam', 'bar': 'foo'} | |
share improve t |
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
#!/bin/bash | |
# Adding postgres and python 3 to our package sources | |
sudo su -c "echo \"deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main 9.6\" > /etc/apt/sources.list.d/postgresql.list" | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
sudo add-apt-repository ppa:jonathonf/python-3.6 -y | |
sudo apt-get update -y | |
# Install python 3.6 dependencies |
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
###################################################### | |
# Base Configuration; this provides sane defaults | |
# for commonly used parts. | |
# --------------------------------------------------- | |
# | |
# Buildout instructions in this file are | |
# usually only changed by experienced developers. | |
# | |
# Beyond here there be dragons! |
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
# First, install some dependencies: | |
sudo apt-get install build-essential checkinstall -y | |
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev -y | |
# Then download using the following command: | |
version=$1 | |
if [ -z "$1" ] | |
then | |
version=2.7.14 | |
fi |
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
curl -s https://gist.githubusercontent.com/b4oshany/ed5cbd74a6ae19571b3d1ca3e4e13e69/raw/777c678360a37db505f974071413f28b9bec60b0/install-python2.7-apt.sh | bash | |
sudo apt-get update -y | |
sudo apt-get install python-pip -y | |
sudo pip install virtualenv | |
sudo apt-get install python-pil -y | |
sudo apt install python2.7 python2.7-dev python-setuptools python-dev build-essential libssl-dev libxml2-dev libxslt1-dev libbz2-dev libjpeg62-dev -y | |
sudo apt install libreadline-dev wv poppler-utils -y | |
sudo pip install bcrypt | |
sudo apt-get install libffi-dev -y | |
sudo apt-get install libpcre3-dev -y |
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
#!/bin/bash | |
sudo apt-get update | |
if [ -z $(which node) ]; then | |
# curl -sL https://deb.nodesource.com/setup | bash - | |
sudo apt-get install -y nodejs | |
fi | |
if [ -z $(which npm) ]; then |
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
/** Accordion styles **/ | |
.accordions { | |
background: white; | |
padding: 16px 8px; | |
} | |
.accordion { | |
background-color: white; | |
color: #444; | |
cursor: pointer; |
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
*** Keywords *** | |
Open Chrome | |
[Arguments] ${url} | |
${chrome_options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver | |
Call Method ${chrome_options} add_argument --disable-extensions | |
Call Method ${chrome_options} add_argument --headless | |
Call Method ${chrome_options} add_argument --disable-gpu | |
Call Method ${chrome_options} add_argument --no-sandbox | |
Create Webdriver Chrome chrome_options=${chrome_options} |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<rules | |
xmlns="http://namespaces.plone.org/diazo" | |
xmlns:css="http://namespaces.plone.org/diazo/css" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" | |
xmlns:xi="http://www.w3.org/2001/XInclude"> | |
<!-- Transform Mosaic Grid to Bootstrap Grid --> | |
<rules css:content="body.mosaic-grid.template-layout"> | |
<replace css:content=".mosaic-grid-row"> |
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
upstream plone { | |
server 127.0.0.1:12030; | |
server 127.0.0.1:12031; | |
} | |
server { | |
server_name <<<Site>>>; | |
access_log /var/log/nginx/<<<Site>>>.access.log; | |
error_log /var/log/nginx/<<<Site>>>.error.log; | |
set $vh_protocol "https"; |