Skip to content

Instantly share code, notes, and snippets.

<?php
echo "Hello RCE";
@bsorin
bsorin / CONCURRENCY.md
Created June 26, 2018 14:56 — forked from montanaflynn/CONCURRENCY.md
Examples of sequential, concurrent and parallel requests in node.js

Concurrency in JavaScript

Javascript is a programming language with a peculiar twist. Its event driven model means that nothing blocks and everything runs concurrently. This is not to be confused with the same type of concurrency as running in parallel on multiple cores. Javascript is single threaded so each program runs on a single core yet every line of code executes without waiting for anything to return. This sounds weird but it's true. If you want to have any type of sequential ordering you can use events, callbacks, or as of late promises.

@bsorin
bsorin / test.js
Created June 21, 2017 12:58
test
alert(1)
@bsorin
bsorin / 0_reuse_code.js
Created January 20, 2017 08:56
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
@bsorin
bsorin / best_practices_gc_js.txt
Created November 11, 2015 14:09
Best practices for reducing Garbage Collector activity in Javascript
Source: http://stackoverflow.com/questions/18364175/best-practices-for-reducing-garbage-collector-activity-in-javascript
A lot of the things you need to do to minimize GC churn go against what is considered idiomatic JS in most other scenarios, so please keep in mind the context when judging the advice I give.
Allocation happens in modern interpreters in several places:
When you create an object via new or via literal syntax [...], or {}.
When you concatenate strings.
When you enter a scope that contains function declarations.
When you perform an action that triggers an exception.

Keybase proof

I hereby claim:

  • I am bsorin on github.
  • I am bsorin (https://keybase.io/bsorin) on keybase.
  • I have a public key whose fingerprint is AE30 67BA 17D5 26D5 AABF 869F 4D4C 911C 58F3 5E95

To claim this, I am signing this object: