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
SELECT | |
(SELECT | |
TOP 1 u.* | |
FROM | |
actionDetail d | |
LEFT JOIN actionLog l ON l.actionId = d.actionId | |
LEFT JOIN users u ON l.userId = u.userId | |
WHERE d.actionId = @actionId | |
FOR JSON PATH) AS userData, | |
(SELECT |
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 Parse = function(string) { | |
try { | |
var object = JSON.parse(string); | |
if(typeof(object) == 'object' || typeof(object) == 'array') | |
return object; // return converted object | |
if(typeof(object) == 'number') | |
return string; // return number string | |
} catch (err) { |
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
/* | |
This script uses https://github.com/tj/node-migrate module for NodeJs | |
Installing: | |
1. npm install -g grunt-cli | |
2. npm install grunt --save-dev | |
3. npm install migrate -g | |
Running from console: | |
1. migrate create migration_script |
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
<html> | |
<head> | |
@section('css') | |
@show | |
</head> | |
<body class="desktop-detected pace-done"> | |
<div id="content-wrap"> | |
@section('content') | |
<p>Main content</p> | |
@show |
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
/** | |
* Ability to check any count of policies in OR ordering | |
* @author Yuriy Syedin <[email protected]> | |
* @returns {Function} | |
*/ | |
module.exports = function () { | |
var makeFakeForbidden = function (policies, p, req, res, next) { | |
if (!policies[p + 1]) return res; // if there is no next policy, that should be verified - leave result as it is | |
var customRes = {}; // init empty response object |
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
/** | |
* ImageController | |
* | |
* @description :: Server-side logic for managing Images | |
* @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers | |
*/ | |
module.exports = { | |
uploadImage: function(req, res) { | |
req.file('image').upload({ |