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
let session = URLSession.shared | |
let task = session.dataTask(with: request as URLRequest, completionHandler: {(data, response, error) in | |
if (error == nil) { | |
do { | |
let json = try! JSONSerialization.jsonObject(with: data!, options: []) | |
let books = Mapper<BookResponse>.mapArray(json) // ERROR: Argument labels '(_:)' do not match any available overloads | |
if let jsonResult = try JSONSerialization.jsonObject(with: data!, options: []) as? NSDictionary { |
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 datetime | |
from uuid import uuid4 | |
from sqlalchemy import Column, Unicode, String, Integer, ForeignKey, UnicodeText | |
from sqlalchemy.dialects.postgresql import UUID | |
from sqlalchemy.orm import relationship | |
from websauna.system.model.meta import Base | |
from websauna.system.model.columns import UTCDateTime |
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
folder/f976c2d2-31c1-4e0c-977f-b997eba57c2c | |
[{ | |
TrackNameInEnglish = "01 Mateo 01"; | |
TrackNameInSpanish = "01 Mateo 01"; | |
TrackPath = "/media/tracks/tracks_all/cf70554c-8354-443c-93a6-ae88a892bb39/e95acdeb-b812-486f-a91e-3c15442c4_8bFILXo.mp3"; | |
id = "9a45ad00-f3af-4830-a57e-834d588da19a"; | |
trackFrombucket = "https://s3-us-west-2.amazonaws.com/rvg-tracks-cdn/e95acdeb-b812-486f-a91e-3c15442c4_8bFILXo.mp3"; | |
}, { | |
TrackNameInEnglish = "01 Mateo 02"; |
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
# pserve and command line configuration for a local development machine | |
[includes] | |
include_ini_files = | |
resource://websauna/conf/development.ini | |
resource://kjvrvg/conf/base.ini | |
resource://websauna/conf/base.ini | |
[app:main] | |
websauna.site_id = kjvrvg_dev |
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 cornice.service import Service | |
import jwt | |
from jwt import ExpiredSignatureError | |
import pem | |
from ccxact.token.generator import TokenGenerator | |
from ccxact.token.validator import TokenValidator | |
# Configure view named home at path / using a template ccxact/home.html | |
@simple_route("/", route_name="home", renderer='ccxact/home.html') |
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
fatal: [myapp_production]: FAILED! => {"changed": true, | |
"cmd": ["/srv/pyramid/myapp/venv/bin/ws-alembic", | |
"-c", | |
"/srv/pyramid/myapp/myapp/conf/generated.ini", | |
"upgrade", | |
"head"], | |
"delta": "0:00:02.786108", | |
"end": "2017-03-05 16:33:24.749291", | |
"failed": true, | |
"rc": 1, |
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
* start ssh-agent on server * | |
* generate priv and pub rsa key in ~/.ssh/ * | |
* add rsakey.pub to bitbucket.org * | |
on server: | |
maz@sidha:~/.ssh$ ssh -T [email protected] | |
The authenticity of host 'bitbucket.org (2401:1d80:1010::150)' can't be established. | |
RSA key fingerprint is SHA256:zzXQOXSRBEiUtuE8AikJYKwbHaxvSc0ojez9YXaGp1A. | |
Are you sure you want to continue connecting (yes/no)? yes | |
Warning: Permanently added 'bitbucket.org,2401:1d80:1010::150' (RSA) to the list of known hosts. |
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
~/src/ansible/websauna.ansible (master ✔) ᐅ ansible-playbook -i hosts.ini playbook-myapp.yml | |
PLAY [myapp_development] ******************************************************* | |
TASK [setup] ******************************************************************* | |
ok: [myapp_development] | |
TASK [include_vars] ************************************************************ | |
ok: [myapp_development] |
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
~/src/ansible/websauna.ansible (master ✔) ᐅ ansible-playbook -i hosts.ini playbook-myapp.yml -k -K -s | |
SSH password: | |
SUDO password[defaults to SSH password]: | |
PLAY [myapp_development] ******************************************************* | |
TASK [setup] ******************************************************************* | |
ok: [myapp_development] | |
TASK [include_vars] ************************************************************ |
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
"""App entry point and configuration.""" | |
import pem | |
from pyramid.authorization import ACLAuthorizationPolicy | |
import websauna.system | |
class Initializer(websauna.system.Initializer): | |
"""An initialization configuration used for starting xact. | |
Override parent class methods to customize application behavior. |