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
test |
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
(function ($) { | |
$.pluginName = function (el, options) { | |
// To avoid scope issues, use 'self' instead of 'this' | |
// to reference this class from internal events and functions. | |
var self = this; | |
// Access to jQuery and DOM versions of element | |
self.$el = $(el); | |
self.el = el; | |
self.elId = self.$el.attr('id'); |
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
import {Observable} from "rxjs"; | |
import {Subject} from "rxjs"; | |
// import {Observable} from "rxjs/Observable"; | |
// import "rxjs/add/operator/map"; | |
// import "rxjs/add/operator/filter"; | |
let numbers = [1, 5, 10, 15]; | |
let arrSource = Observable.from(numbers); |
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 observable = Rx.Observable.create(function (observer) { | |
observer.next(1); | |
observer.next(2); | |
observer.next(3); | |
setTimeout(() => { | |
observer.next(4); | |
observer.complete(); | |
}, 1000); | |
}); |
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 foo = Rx.Observable.create(function (observer) { | |
console.log('Hello'); | |
observer.next(42); | |
}); | |
foo.subscribe(function (x) { | |
console.log(x); | |
}); | |
foo.subscribe(function (y) { | |
console.log(y); |
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
declare @i int | |
set @i = 1 | |
while @i <= 100000 | |
begin | |
INSERT INTO [dbo].[Log] ([Key], [Data], [UpdatedDate]) | |
VALUES | |
(convert(nchar(36), NEWID()), | |
'Some random data:' + convert(nchar(36), NEWID()), | |
GETDATE()) |
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 start = new Date(); | |
for (var i = 1; i <= 100000; i++) { | |
db.getCollection('log').insert({ | |
"key": (new ObjectId()).toString(), | |
"data": "some random data: " + (new ObjectId()).toString(), | |
"updated_date": new Date() | |
}) | |
} | |
print(new Date() - start); |
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
db.system.js.save({ | |
_id: "test", | |
value: function () { | |
var start = new Date(); | |
for (var i = 1; i <= 100000; i++) { | |
db.getCollection('log').insert({ | |
"key": (new ObjectId()).toString(), | |
"data": "some random data: " + (new ObjectId()).toString(), | |
"updated_date": new Date() | |
}) |
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
using (var dbContext = new MainDbContext()) | |
{ | |
for (var i = 0; i < 100000; i++) | |
{ | |
dbContext.Database.ExecuteSqlCommand( | |
@"INSERT INTO [dbo].[Log] ([Key], [Data], [UpdatedDate]) | |
VALUES ( | |
convert(nchar(36), NEWID()), | |
'Some random data:' + convert(nchar(36), NEWID()), | |
GETDATE())"); |
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
for (var i = 0; i < 100000; i++) | |
{ | |
using (var dbContext = new MainDbContext()) | |
{ | |
dbContext.Logs.Add(new Log() | |
{ | |
Key = Guid.NewGuid().ToString("D"), | |
Data = "some random data:" + Guid.NewGuid().ToString("D"), | |
UpdatedDate = DateTime.UtcNow | |
}); |
OlderNewer