Skip to content

Instantly share code, notes, and snippets.

@nin-jin
nin-jin / _README.md
Created January 30, 2023 15:20 — forked from lord-alfred/_README.md
Y-Factors Formula

Y-Factors Formula

Здесь опубликованы коэффициенты для одного из внутренних ранжировщиков в поиске Яндекса. Это не итоговая формула, которая влияет на результат появления ссылки в серпе, т.к. судя по изученному коду – внутри используется несколько ранжировщиков и поисковых движков, результаты которых мержатся между собой и уже итоговый результат приводит к распределению ссылок по топу выдачи.

коэффициенты влияния на факторы

| Коэффициент | Название Фактора | Описание Фактора |

@nin-jin
nin-jin / Atom.ts
Last active January 26, 2023 13:54
0.5KB optimal error-proof finegrained lazy pull reactivity with suspense and scheduler
export class Atom< Input = never, Output = unknown > extends Object {
static Track = null as null | Atom< any, any >
static Index = 0
static Timer = 0
static _plan: any
static plan() {
if( this._plan ) return
@nin-jin
nin-jin / wire.md
Last active July 7, 2023 06:53
JS Proposal: Auto Wire

Reactivity API to wire any reactive libs and native states together. It allows to mix different reactive libs, use async functions with automatic dependency tracking, observe any states in same way, make native DOM reactive etc.

Rationale

Current State

  1. Most of modern apps based on reactive paradigm.
  2. Popular and promising approach is pull-reactivity.
  3. Pull-reactivity achieves automatic dependency trackig, automatic data-flow optimization and resources lifetime control. See the analysis of reactivity approaches.
  4. Famed pull-reactivity libs: MobX, VueJS, $mol.
@nin-jin
nin-jin / tests.ts
Last active March 13, 2020 10:51
Статикодинамические валидаторы
type TestUserType = Assert<
typeof User.Value,
{
readonly name: string
readonly birthday: Moment
readonly email: string & { Brand: "Email" } | undefined
}
>
@nin-jin
nin-jin / harp-request.md
Last active December 1, 2021 12:53
HARP - Hypermedia Abstract Resource Protocol

Requirements:

  1. One line query through uri.
  2. Filtering
  3. Sorting
  4. Limitation
  5. Partial fetching
  6. Fetching linked resources
  7. Normalized response
  8. Bulk requests
@nin-jin
nin-jin / args.js
Created May 2, 2017 10:50
NodeJS arguments processing
var args = {}
process.argv.slice(2).forEach( param => {
var values = param.split( '=' )
var key = values.shift()
args[ key ] = ( args[ key ] || [] ).concat( values.join( '=' ) )
} )
var actions = {
'help help' : args => `help\t\tPrints help (default action)\n` ,
'help' : args => `\nSuper-puper server!\n${ actions['actions']() }${ actions['options']() }`,
import std.stdio;
T eval( string op , T )( T a , T b ) {
return mixin( q{a} ~ op ~ q{b} );
}
unittest {
writeln( eval!q{/}( 123 , 0 ) );
}
@nin-jin
nin-jin / coroutine.d
Last active October 9, 2015 14:59
Sorting comparison
import vibe.core.core;
import core.time;
import std.stdio;
int counter;
void say( string name ) {
for ( int i = 0 ; i < 3; i++ ) {
sleep( 100.msecs );
writeln( ++counter , " " , name );