Skip to content

Instantly share code, notes, and snippets.

View nsanitate's full-sized avatar

Nicola Sanitate nsanitate

View GitHub Profile
@nsanitate
nsanitate / FakeActor.cs
Created February 14, 2018 11:06
Simple test on PersistentActor raise timeout exception
public class FakeActor : ReceivePersistentActor
{
public override string PersistenceId { get; } = "HashCoded";
public FakeActor()
{
Command<FakeRequest>(request =>
{
Sender.Tell(new FakeResponse(requestId: request.RequestId));
});
@nsanitate
nsanitate / index.html
Last active July 6, 2017 13:21
Performance test between lodash, rxjs and procedural approach// source https://jsbin.com/hiqibos
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://cdn.jsdelivr.net/lodash/4/lodash.min.js"></script>
<script src="https://unpkg.com/@reactivex/rxjs@5.0.3/dist/global/Rx.js"></script>
@nsanitate
nsanitate / destructuring.js
Last active December 16, 2015 10:25
ES6 destructuring scenario
var people = [
{
"firstName": "Myrna",
"lastName": "Dale",
"phone": "+1 (949) 521-2228",
"email": "myrna.dale@entroflex.io",
"address": "500 Kaufman Place, Hamilton, Oklahoma, 1836"
},
{
"firstName": "Vega",
@nsanitate
nsanitate / default_value.js
Created December 16, 2015 09:13
ES6 default value scenario
function greet(greeting, name = 'John') {
console.log(greeting + ', ' + name);
}
greet('Hello');
@nsanitate
nsanitate / lambda.js
Last active December 16, 2015 09:14
ES6 lambda scenario
var deliveryBoy = {
name: 'John',
handleMessage: function (message, handler) {
handler(message);
},
receive: function() {
this.handleMessage('Hello, ', message => console.log(message, this.name));
}
@nsanitate
nsanitate / let.js
Created December 16, 2015 09:01
ES6 let scenario
var fs = [];
for(let i = 0; i < 10; i++) {
fs.push(() => console.log(i));
}
fs.forEach(f => f());
@nsanitate
nsanitate / padding_in_width.css
Created December 15, 2015 10:59
Include padding in elements calculated widths
* , *:before, *:after {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
@nsanitate
nsanitate / keybase.md
Created October 15, 2014 12:28
Keybase proof

Keybase proof

I hereby claim:

  • I am nsanitate on github.
  • I am nsanitate (https://keybase.io/nsanitate) on keybase.
  • I have a public key whose fingerprint is CFB9 C784 F67A C5CC FAE2 0E7D 61F2 E0ED 6319 BB01

To claim this, I am signing this object: