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
/* Replace your multiparty/index.js inside node_modules with the code below. | |
* Example: | |
* var EXT_RE = /(\.[_\-a-zA-Z0-9]{0,16}).* /; <- remove space | |
* var options = { | |
* filename: function(filename, callback){ | |
* var name = filename.replace(EXT_RE, ""); | |
* callback(name+'-YEAH-'+1234+'.png'); | |
* } | |
* } | |
* // if using multiparty |
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
{ | |
"userId": 47, | |
"userName": "Agente 47", | |
"age": 27, | |
"address": { | |
"streetNumber": "3000", | |
"streetName": "Wellington Square Street" | |
} | |
} |
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
router.get('/:id', function(req, res) { | |
var id = req.params.id; | |
var json = { | |
userId: id, | |
userName: "Agente "+id, | |
age: 27, | |
address: { | |
streetNumber: "3000", | |
streetName: "Wellington Square Street" | |
} |
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
/* arquivo: routes/index.js | |
* url de resposta: http://localhost:3000/respondeaqui | |
*/ | |
router.get('/respondeaqui', function(req, res, next) { | |
res.send('ok'); | |
}); |
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
/* arquivo: routes/users.js | |
* url de resposta: http://localhost:3000/users/aquiagora | |
*/ | |
router.get('/aquiagora', function(req, res, next) { | |
res.send('ok'); | |
}); |
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 routes = require('./routes/index'); //#1 | |
var users = require('./routes/users'); //#2 | |
... | |
app.use('/', routes); //#3 | |
app.use('/users', users); //#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
#!/bin/bash | |
# | |
# backelite-sonar-swift-plugin - Enables analysis of Swift and Objective-C projects into SonarQube. | |
# Copyright © 2015 Backelite (${email}) | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU Lesser General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# |
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
# | |
# Swift SonarQube Plugin - Enables analysis of Swift and Objective-C projects into SonarQube. | |
# Copyright © 2015 Backelite (${email}) | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU Lesser General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
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
func sum(v1: Int, v2: Int) -> Int { | |
return v1 + v2 | |
} | |
func sub(v1: Int, v2: Int) -> Int { | |
return v1 - v2 | |
} | |
func operation (_ operation: @escaping (Int, Int) -> Int) -> (Int, Int) -> Int { | |
return { v1, v2 in |
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
class Drink: Codable { | |
var name: String | |
var color: String? | |
private enum CodingKeys: String, CodingKey { | |
case name, color | |
} | |
required init(from decoder: Decoder) throws { | |
let values = try decoder.container(keyedBy: CodingKeys.self) |