Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View InKolev's full-sized avatar

Ivan Kolev InKolev

  • Bulgaria
View GitHub Profile
@InKolev
InKolev / 0_reuse_code.js
Last active August 29, 2015 14:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@InKolev
InKolev / Latencies.txt
Last active February 3, 2017 17:02 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
$(function () {
// TODO: expand
const filetypeMap = {
'javascript': 'js',
'haskell': 'hs'
};
const $fetchBtn = $('#fetch-btn'),
$container = $('#paste-details');
// Place your settings in this file to overwrite default and user settings.
{
"terminal.external.windowsExec": "git-bash",
"eslint.enable": true,
"eslint.options": {
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "es6",
"env": {
"es6": true

Load/Stress testing

Netling is a load tester client for easy web testing. It is extremely fast while using little CPU or memory.

Quick and easy URL and load testing for your Web applications.
West Wind WebSurge is a Windows application that helps you to easily capture and play back URL requests, either individually for easy application, service and API testing scenarios, or under heavy load for stress testing scenarios. WebSurge makes it easy to save, share and reuse URL sessions you have created, so you can easily start up sessions again on your own or somebody else's machine.

Unstage all files staged for commit

  • Command
git reset HEAD -- .

Revert to previous commit, discarding all changes made locally

  • Command
git reset --hard HEAD

Unit testing - Brief overview

The definition of a unit test (by Roy Osherove)

Prerequisites

A unit of work is the sum of actions that take place between the invocation of a public method in the system and a single noticeable end result by a test of that system. A noticeable end result can be observed without looking at the internal state of the system and only through its public APIs and behavior. An end result is any of the following:

  • The invoked public method returns a value (a function that’s not void).
  • There’s a noticeable change to the state or behavior of the system before and after invocation that can be determined without interrogating private state.
  • There’s a callout to a third-party system over which the test has no control, and that third-party system doesn’t return any value, or any return value from that system is ignored. (Example: calling a third-party logging system that was not written by you and you don’t have the source to.)

Memory Management in .NET

"If you don't ultimately have a root reference, then you can't be accessed, so you must die."

Brief overview

SOH:

  • Allocates objects smaller than 85K
  • Objects are allocated on top of each other, a Next Object Pointer (NOP) represents the location where the next object will be allocated.
  • Because the NOP position is known, a new object can be immediately allocated without the overhead of looking for space in a Free Space tables.

Local IP addresses

Kafka: 172.18.0.4
Zookeeper: 172.18.0.2

Useful commands

  • Create a topic named integration-test-topic with two partitions:

    • kafka-topics --create --zookeeper 172.18.0.2:3001 --replication-factor 1 --partitions 2 --topic integration-test-topic
  • Check topic information:

  • kafka-topics --zookeeper 172.18.0.2:3001 --describe --topic integration-test-topic