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
This is my composer.json file... | |
{ | |
"name": "api.ibl.org", | |
"version": "0.0.1", | |
"repositories": [ | |
{ | |
"type": "package", | |
"package": { | |
"name": "codeguy/slim", |
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
A joke for lent: | |
Just before Pancake Tuesday Jim married his incredibly sexy Irish Catholic girlfriend Mary. | |
They had a long flight for their honeymoon in Hawaii, getting delayed until Ash Wednesday. | |
Finally alone in their hotel room Jim intended to consumate the marriage. | |
Mary blushed and said "Jim, I can't do that! It's Lent" | |
Jim went nuts: "Leant? To who and for how long?!?" |
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
Here is the scenario I am writing: | |
Scenario: Create new store with one test product | |
Given I make the API call "/api/" | |
When I post a test product | |
Then I should get back | |
""" | |
callback({"success":"true","storeId":"<integer>", "url":"<string>", "embed":"<string>"}) | |
""" |
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
// Check to make sure that our valid fields are in there | |
$requiredFields = array( | |
'price', | |
'name', | |
'description', | |
'type', | |
'shippingCost', | |
'vendorSku' | |
); | |
$valid = true; |
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
// Check to make sure that our valid fields are in there | |
$requiredFields = array( | |
'price' => 1, | |
'name' => 1, | |
'description' => 1, | |
'type' => 1, | |
'shippingCost' => 1, | |
'vendorSku' => 1 | |
); | |
$valid = true; |
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
$requiredFields = array( | |
'price', | |
'name', | |
'description', | |
'type', | |
'shippingCost', | |
'vendorSku' | |
); | |
$valid = true; | |
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
var http = require('http'); | |
var pg = require('pg'); | |
var connectionString = "pg://chartjes:********@localhost:5432/ibl_stats"; | |
pg.connect(connectionString, function(err, client) { | |
if (err) { | |
console.log(err); | |
} else { | |
http.createServer(function(request, response) { | |
response.writeHead(200, {'Content-Type': 'text/html'}); |
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
var http = require('http'); | |
var pg = require('pg'); | |
var connectionString = "pg://chartjes:*******@localhost:5432/ibl_stats"; | |
pg.connect(connectionString, function(err, client) { | |
if (err) { | |
console.log(err); | |
} else { | |
http.createServer(function(request, response) { | |
response.writeHead(200, {'Content-Type': 'application/json'}); |
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
var q = "SELECT * " + | |
"FROM transaction_log " + | |
"WHERE log_entry LIKE 'Trades%' " + | |
"AND transaction_date <= (SELECT MAX(transaction_date) FROM transaction_log) " + | |
"AND transaction_date >= (SELECT MAX(transaction_date) FROM transaction_log)-'3 weeks'::interval " + | |
"ORDER BY trans_id DESC "; |
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
// Front controller for our API | |
var application_root = __dirname; | |
var express = require("express"); | |
var path = require("path"); | |
var pg = require('pg'); | |
var app = express.createServer(); | |
function TransactionModel(pg) { | |
this.getCurrent = function(pg) { |