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 | |
if (!empty($data['image']) && !empty($data['image']['entity']) && !empty($data['image']['entity']['fid'])) { | |
$fid = $data['image']['entity']['fid']; | |
} |
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
// Impure function | |
const b = 10 | |
const impureFunction = (a) => { | |
return a + b; | |
} | |
impureFunction(4) |
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
############################ | |
## TERMINAL CUSTOMIZATION ## | |
############################ | |
# Function to handle current git branch | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
# Show git branch on underlined path |
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 ElHelper = require('../helpers.js'), | |
path = require('path'), | |
project = { | |
name: 'Sample Website', | |
domain: 'http://localhost:3010', | |
picture: path.resolve(__dirname, '../../files/logo.png') | |
}; | |
var userInfo = ElHelper.user.getSample('tester'); | |
var organizationInfo = ElHelper.organization.getSample(); |
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 a = new Boolean(validator.isEmail(item[settings.name].toString())); | |
var b = !!validator.isEmail(item[settings.name].toString()); | |
// -- wrong email = demo@demo | |
console.log("a: ", a); // a: {} | |
console.log("b: ", b); // b: false | |
console.log("a || 'Invalid email.': ", a || 'Invalid email.'); // a || 'Invalid email.': {} |
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
server { | |
server_name tracker.io; | |
listen 80; | |
root /home/joseph/taller/el-tracker; | |
try_files $uri @nodejs; | |
location @nodejs { | |
proxy_set_header X-Real-IP $remote_addr; |
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
Structure of tests directories in El-tracker | |
---------------------------------------------- | |
el-tracker/test/config/ --> Configurations files | |
el-tracker/test/config/Karma.conf.js | |
el-tracker/test/config/protractor.conf.js | |
el-tracker/test/config/mocha-runner.js | |
el-tracker/test/lib/ | |
el-tracker/test/frontend/ ---> Frontend test directory | |
el-tracker/test/frontend/e2e |
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 allowCrossDomain = function(req, res, next) { | |
res.header('Access-Control-Allow-Origin', '*'); | |
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE'); | |
res.header('Access-Control-Allow-Headers', 'Content-Type'); | |
next(); | |
} | |
app.configure(function() { | |
app.use(express.bodyParser()); |
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
project.createExecutionCDN = function (projectId, extensionDir) { | |
var deferred = Q.defer(); | |
var filePath = path.join(extensionDir, 'project', projectId + '.js'); | |
var defaultCdnPath = path.join(extensionDir, 'execution.js'); | |
// verify if exist cdn-project-id.js file | |
fs.exists(filePath, function (exists) { | |
// Handler if the project cdn not exist. | |
if (!exists) { |
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
-------- Project X | |
<!-- load cdn de execution --> | |
<script src="http://el-tracker.com/cdn/projectId"></script> | |
------- project.router.js | |
>> path: /cdn/:projectId | |
- get param projectId | |
- verify if exist project? |
NewerOlder