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
val kafka = new ReactiveKafka() | |
val consumerProperties = toConsumerProperties(config, new MyDecoder()) | |
val publisher = kafka.consume(consumerProperties) | |
Source(publisher) | |
.map { ... | |
.runForeach(_ => ()) | |
val publisher2 = kafka.consume(consumerProperties) |
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
run.sh |
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
connect hr/hr; | |
set echo on | |
BEGIN | |
FOR i IN 1..50 LOOP | |
execute immediate 'select * from hr.employees where employee_id = 115'; | |
END LOOP; | |
END; | |
/ |
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
def findByEmail(email: String): Option[NativeUser] = { | |
DB.withConnection{ implicit connection => | |
SQL("SELECT id, firstName, lastName, email, password, hasAvatar FROM appUser WHERE email={email}").on('email -> email)().collectFirst { | |
case Row(id: Long, firstName: String, lastName: String, email: String, password: String, hasAvatar: Boolean) => NativeUser(anorm.Id(id), firstName, lastName, email, password, hasAvatar) | |
} | |
} | |
} |
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
function validateLogin(input){ | |
if(input.val().length < 1){ | |
addMessage(input.parent(), 'Please provide login'); | |
return false; | |
} | |
if(!input.val().match(/^[a-zA-Z0-9_-]+$/)){ | |
addMessage(input.parent(), 'Provided login contains invalid characters (letters, numbers, hyphen and underscore allowed)'); | |
return false; | |
} | |
$.get("isLoginAvailable/" + $("#login").val(), function(data){ |
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
function validateLogin(input){ | |
if(input.val().length < 1){ | |
addMessage(input.parent(), 'Please provide login'); | |
return false; | |
} | |
if(!input.val().match(/^[a-zA-Z0-9_-]+$/)){ | |
addMessage(input.parent(), 'Provided login contains invalid characters (letters, numbers, hyphen and underscore allowed)'); | |
return false; | |
} | |
$.get("isLoginAvailable/" + $("#login").val(), function(data){ |
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
michal@debian~/Desktop/programming/node.js/simple-bookmarks [master]$ git status | |
# On branch master | |
# Untracked files: | |
# (use "git add <file>..." to include in what will be committed) | |
# | |
# decorator.js | |
# dokumentacja/analiza.systemu.aux | |
# dokumentacja/biblio.aux | |
# dokumentacja/index.aux | |
# dokumentacja/index.out |
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
[email protected] /home/michal/Desktop/programming/node.js/simple-bookmarks | |
├─┬ [email protected] | |
│ └── [email protected] | |
├─┬ [email protected] | |
│ └── [email protected] | |
├── UNMET DEPENDENCY crypto >= 0.0.3 | |
├─┬ [email protected] | |
│ ├─┬ [email protected] | |
│ │ └── [email protected] | |
│ ├── [email protected] |
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
exports.processLogin = function (req, res){ | |
var User = mongoose.model('Users'); | |
var id; | |
var u = User.where('login', req.body.login).find({}, function(err, docs){ | |
req.session.userId = docs[0]._id; | |
User.where('login', req.body.login).where('password', models.createHash(req.body.password)).count(function(err, count){ | |
if(err || count == 0) | |
res.render('login', {title: 'log in'}); | |
else{ | |
req.session.loggedIn = 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
/** | |
* Zwalnia wszyskie bloki pamieci oraz sama liste. | |
*/ | |
void dispose_list(struct list * l){ | |
struct block * it = l->first, *tmp; | |
while(it != NULL){ | |
tmp = it->next; | |
delete_block(it, l); | |
it = tmp; | |
} |