Skip to content

Instantly share code, notes, and snippets.

View ufocoder's full-sized avatar
👽
🛸

Sergey ufocoder

👽
🛸
View GitHub Profile
section .text
global _start
_start:
xor eax, eax ; init eax 0
xor ebx, ebx ; init ebx 0
xor esi, esi ; init esi 0
jmp _socket ; jmp to _socket
_socket_call:
Провел неделю в переходящем коллективном твиттер аккаунте https://twitter.com/jsunderhood
Ведение такого аккаунта требует много внимания и сил, нужно было находиться в балансе между юмором и техническими деталями.
Пришлось очень много писать, поэтому местами есть опечатки, пропущенные слова, но на общую суть повествования,
надеюсь, это не повлияло.
Треды:
- JavaScript - это не магия: https://twitter.com/jsunderhood/status/1315601379130576897
- JavaScript и динамическая типизация: https://twitter.com/jsunderhood/status/1315977006010466305
- JavaScript и Браузер: https://twitter.com/jsunderhood/status/1316346887226654722
@ufocoder
ufocoder / hidden-classes-in-js-and-inline-caching.md
Created October 13, 2020 13:27 — forked from twokul/hidden-classes-in-js-and-inline-caching.md
Hidden classes in JavaScript and Inline Caching

Hidden classes in JavaScript and Inline Caching

Knowing how internals work is always a good. Pretty much for everything. Cars, trains, computers, you name it. It gives you an insight on what happens under the hood. You also act/react differently based on this knowledge.

As you might have guessed, it’s also true for web development. Knowledge of CSS transitions allows you to achieve better performance and not to use JavaScript in most cases. Knowledge of V8 internals allows you to write more performant JavaScript code. So let’s talk about V8 a little.

A little about V8

V8 is a JavaScript engine built by Google. Firefox built SpiderMonkey, Opera built Carakan and Microsoft built Chakra. One very important difference between V8 and other JavaScript engines is that V8 doesn’t generate any intermediate code. It compiles JavaScr

@ufocoder
ufocoder / js-questions.md
Last active August 1, 2019 12:20 — forked from AntonGorelov/js-questions.md
JS questions
  1. Что покажут эти два alert()?
var foo = 'Hello';

(function() {
  var bar = ' World';
  console.log(foo + bar);
})();

console.log(foo + bar);
def gcd(a, b):
while a!=0 and b!=0:
if a > b:
a = a % b
else:
b = b % a
return a + b
def main():
a, b = map(int, input().split())
def fib_mod(num, mod):
if mod == 1:
return 0
seq = [0, 1]
prev = 0
curr = 1
while True:
prev, curr = curr, (prev + curr) % mod
const memoized = fn => {
const cache = new WeakMap()
return (...args) => {
if (!cache.has(args)) {
cache.set(args, fn(...args))
}
return cache.get(args)
}
}
@ufocoder
ufocoder / fibo.js
Last active January 21, 2019 17:36
const fibonacciRecursive = n => n < 2
? 1
: fibonacciRecursive(n-1) + fibonacciRecursive(n-2)
const fibonacciArray = n => {
let arr = [1, 1]
for (let i = 0; i < n-1; i++) {
arr[i + 2] = arr[i + 1] + arr[i];
}
return arr[n]

Forward Port 80 and 443 with Mac pfctl Port Forwarding You can copy and paste the following onto the command line.

echo "
rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
rdr pass inet proto tcp from any to any port 443 -> 127.0.0.1 port 8443
" | sudo pfctl -ef -

Remove Port Forwarding

<script>
var detectors = [
{
src: "https://squareup.com/login?return_to=%2Ffavicon.ico",
name: "Square"
}, {
src: "https://twitter.com/login?redirect_after_login=https%3a%2f%2ftwitter.com%2ffavicon.ico",
name: "Twitter"
}, {
src: "https://www.facebook.com/login.php?next=https%3A%2F%2Fwww.facebook.com%2Ffavicon.ico%3F_rdr%3Dp",