Proof of concept Marionette, the next generation of FirefoxDriver.
Download recent firefox, for instance latest aurora, and install.
$script = <<SCRIPT | |
yum install -y epel-release | |
yum install -y postgresql-server | |
postgresql-setup initdb | |
systemctl enable --now postgresql | |
yum install -y yum-utils | |
yum-config-manager --add-repo=https://nightly.odoo.com/10.0/nightly/rpm/odoo.repo | |
yum install -y odoo | |
systemctl enable --now odoo | |
yum install -y https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.1/wkhtmltox-0.12.1_linux-centos7-amd64.rpm |
#!/bin/bash | |
# AUTHOR: (c) Rob W 2012 | |
# modified by MHC (http://askubuntu.com/users/81372/mhc) | |
# and by Rodolfo Carvalho | |
# NAME: GIFRecord 0.1-fedora | |
# DESCRIPTION: A script to record GIF screencasts. | |
# LICENSE: GNU GPL v3 (http://www.gnu.org/licenses/gpl.html) | |
# DEPENDENCIES: byzanz,zenity,notify-send |
import datetime as dt | |
from collections import OrderedDict as odict | |
import inspect | |
import types | |
from rest_framework import serializers | |
def function(a: int, b: str): | |
pass |
Proof of concept Marionette, the next generation of FirefoxDriver.
Download recent firefox, for instance latest aurora, and install.
#!/usr/bin/env python | |
"""Use of a callable to implement lazy evaluation of keys in a dict.""" | |
data = { | |
'name': 'John', | |
'surname': 'Smith', | |
'full_name': lambda x: '{name} {surname}'.format(**x) | |
} | |
import psycopg2 | |
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT | |
import eventlet | |
from eventlet import wsgi | |
from eventlet import websocket | |
from eventlet.hubs import trampoline | |
dsn = "dbname=test" # customise this |
Most commonly because you'd like to use JDBC to connect to your local Postgres server without using password auth. Very quickly you'll realise Unix sockets aren't supported in Java, so you can't use peer
authentication.
First, ensure your /var/lib/pgsql/pg_hba.conf
uses ident
for TCP/IP connections:
# IPv4 local connections:
host all all 127.0.0.1/32 ident
import sqlite3 | |
import yaml | |
DATABASE = 'inventory.db' | |
with open('schema.yaml') as f: | |
schema = yaml.load(f) | |
def create_table(table, *fields): |
#! /usr/bin/env python3 | |
""" Calcula los días transcurridos desde una fecha. | |
""" | |
import datetime | |
DAY_LABELS = "Lunes,Martes,Miércoles,Jueves,Viernes,Sábado,Domingo".split(',') | |
user_date = input('Fecha> ') | |
day, month, year = [int(s) for s in user_date.split('-')] |