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 flask import Flask, render_template, redirect, url_for | |
from flask.ext.sqlalchemy import SQLAlchemy | |
app = Flask(__name__) | |
app.config.from_object('config') | |
db = SQLAlchemy(app) | |
# Basic Routes # |
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
alias c='docker-compose' | |
alias cb='docker-compose build' | |
alias cup='docker-compose up' | |
alias cr='docker-compose run --service-ports --rm' | |
alias crl='docker-compose run --service-ports --rm local' | |
alias crd='docker-compose run --service-ports --rm develop' | |
alias crt='docker-compose run --rm test' | |
alias crp='docker-compose run --rm provision' | |
alias crci='docker-compose run --rm ci' | |
alias crwt='docker-compose run --rm watchtest' |
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
URL="http://stackoverflow.com/" | |
# store the whole response with the status at the and | |
HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X POST $URL) | |
# extract the body | |
HTTP_BODY=$(echo $HTTP_RESPONSE | sed -e 's/HTTPSTATUS\:.*//g') | |
# extract the status | |
HTTP_STATUS=$(echo $HTTP_RESPONSE | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') |
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
var request = require('supertest'), | |
mongoose = require('mongoose'), | |
app = require('../../../../server'); | |
describe('GET /api/transactions/import', function(){ | |
before(function (done) { | |
mongoose.connection.on('open', done); | |
}); | |
it('respond with json', function(done){ |
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
var libxmljs = require("libxmljs"); | |
var xml = [ | |
'<?xml version="1.0" encoding="utf-8"?>', | |
'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">', | |
' <soap:Body>', | |
' <Response xmlns="http://tempuri.org/">', | |
' <Result>', | |
' <client xmlns="">', | |
' <msg>SEARCH OK.</msg>', | |
' <code>0</code>', |
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
// Save a copy of this request for debugging. | |
requestDump, err := httputil.DumpRequest(r, true) | |
if err != nil { | |
fmt.Println("--->DEBUG ERROR", r.URL, err) | |
} | |
fmt.Println("--->DEBUG BODY", r.URL, string(requestDump)) |
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
<pre data-bind="text: ko.toJSON($data, null, 2)"></pre> |
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
-- enable dblink support | |
CREATE EXTENSION dblink; | |
-- create the connection | |
SELECT dblink_connect('myconn', 'dbname=tracking-service'); | |
-- then use the connection | |
SELECT "oauthId" | |
FROM "56_profile" local | |
INNER JOIN dblink('myconn','SELECT DISTINCT user_id FROM "event"') |
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
for i in $(docker ps -aq); do docker inspect -f '{{.Name}}: IP={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$i"; done | grep <ip-here> |
NewerOlder