This file contains hidden or 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
""" | |
Auth views | |
~~~~~~~~~~ | |
""" | |
import functools | |
from pyramid.security import ( | |
remember, | |
forget, |
This file contains hidden or 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
class CreatedAtMixin(object): | |
"""Adds a read-only column created_at to a table | |
An sqlalchemy.exc.ArgumentError will be raised it someone is trying to set | |
created_at. However, the '_created' column can still be set. | |
""" | |
_created = Column('created_at', DateTime, | |
server_default=text('NOW()'), nullable=False) |
This file contains hidden or 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 | |
# Setup iptables and save them | |
iptables --flush | |
iptables --flush -t nat | |
# Forward all ports to openvpn server | |
iptables -t nat -A PREROUTING -d {{ public_openvpn_ip }} -p udp --match multiport --dport 2:1193 -j DNAT --to-destination :1194 | |
iptables -t nat -A PREROUTING -d {{ public_openvpn_ip }} -p udp --match multiport --dport 1195:65535 -j DNAT --to-destination :1194 |
This file contains hidden or 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 | |
[ | |
'price' => [ | |
'retail' => | |
[ | |
'USD' => [ | |
'type' => 'retail', | |
'currency' => 'USD', | |
'value' => 10, |
This file contains hidden or 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
create table made_export ( | |
id int primary key, | |
type varchar(80) not null, | |
); | |
create table made_order_export ( | |
id int primary key references made_export.id, | |
order_id int references order.id, | |
); |
This file contains hidden or 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
class NavisionSoapClient extends ExportClient { | |
} | |
class NavisionOrderFormatter extends ModelFormatter { | |
} | |
class NavisionOrderExportAdapter extends ExportAdapter { | |
} |
This file contains hidden or 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
abstract class ExportMessage { | |
function __construct($type, $params) { | |
$this->_type = $type; | |
$this->_params = $params; | |
} | |
function getType() { | |
return $this->_type; | |
} |
This file contains hidden or 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 | |
interface ExportLogger { | |
function info(); | |
function debug(); | |
function warning(); | |
function error(); | |
function fatal(); | |
} |
This file contains hidden or 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
{% with object.get_main_image_or_none as img %} | |
{% if img %} | |
<div class="img"> | |
<a href="{% url 'view_object' object.gid %}"><img src="{{ img.image_thumbnail.url }}"></a> | |
</div> | |
{% endif %} | |
{% endwith %} |
This file contains hidden or 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
node default { | |
Exec { path => "/bin:/usr/bin:/usr/local/bin" } | |
exec { "apt-get update": command => "apt-get update" } | |
package {'vim': ensure=>installed, } | |
#class { 'postgresql::server': } postgresql::server::db {'pluto_development': user => 'pluto', password => postgresql_password('pluto', 'plutopass'),} |