Skip to content

Instantly share code, notes, and snippets.

View mbIkola's full-sized avatar
🦍
return code || die;

Nickolay Kharchevin mbIkola

🦍
return code || die;
View GitHub Profile
@mbIkola
mbIkola / cr.md
Last active March 4, 2025 13:31
Why Code Review Matters and How to Make Reviewers Love Your Big Pull Requests

Why Code Review Matters and How to Make Reviewers Love Your Big Pull Requests

Why Code Review Matters

Code review is more than just a formality—it’s an essential part of writing high-quality, maintainable software. When you ask for a review, every comment or question is an indication that something in your code is unclear, confusing, or could be improved. Ignoring feedback or dismissing questions as trivial defeats the purpose of the review process.

A good review helps:

  • Catch hidden issues – Reviewers may spot logic flaws, edge cases, or performance concerns that you overlooked.
  • Improve readability – If someone struggles to understand your code, chances are future maintainers will too.
@mbIkola
mbIkola / express_subrouters_list_all.js
Created February 21, 2023 20:57 — forked from creisle/express_subrouters_list_all.js
List all routes registered on an express router with sub-routers
/**
* This is a HACK to fetch all routes from an express
* router with nested sub-routers
*
* It uses the regex pattern added to the sub-router and
* tries to normalize it into something more human readable
* since this doesn't appear to be stored elsewhere as far
* as I could tell
*/
const replaceParams = (string) => {
{
"CountryRegionData": [
[
"Afghanistan",
"AF",
"Badakhshan~BDS|Badghis~BDG|Baghlan~BGL|Balkh~BAL|Bamyan~BAM|Daykundi~DAY|Farah~FRA|Faryab~FYB|Ghazni~GHA|Ghor~GHO|Helmand~HEL|Herat~HER|Jowzjan~JOW|Kabul~KAB|Kandahar~KAN|Kapisa~KAP|Khost~KHO|Kunar~KNR|Kunduz~KDZ|Laghman~LAG|Logar~LOW|Maidan Wardak~WAR|Nangarhar~NAN|Nimruz~NIM|Nuristan~NUR|Paktia~PIA|Paktika~PKA|Panjshir~PAN|Parwan~PAR|Samangan~SAM|Sar-e Pol~SAR|Takhar~TAK|Urozgan~ORU|Zabul~ZAB"
],
[
"Åland Islands",
"AX",
const joi = require('@opower/config-schema');
const schema = joi.object().keys({
str: joi.string().allow(null)
});
console.log("Validate against null:", {res : schema.validate({ str: null })});
console.log("Validate against string:", {res: schema.validate({ str: 'dead-babe' })});
console.log("Using attempt: ", {res: joi.attempt( { str: null }, schema)});
#!/bin/bash
#Spizheno i popravleno otkudato
mkdir -p ~/Pictures/NatGeo
cd ~/Pictures/NatGeo
rm NG_img_of_day
rm NG_img_of_day_site
curl https://www.nationalgeographic.com/photography/photo-of-the-day/ \
-o NG_img_of_day

Everything I Know About UI Routing

Definitions

  1. Location - The location of the application. Usually just a URL, but the location can contain multiple pieces of information that can be used by an app
    1. pathname - The "file/directory" portion of the URL, like invoices/123
    2. search - The stuff after ? in a URL like /assignments?showGrades=1.
    3. query - A parsed version of search, usually an object but not a standard browser feature.
    4. hash - The # portion of the URL. This is not available to servers in request.url so its client only. By default it means which part of the page the user should be scrolled to, but developers use it for various things.
    5. state - Object associated with a location. Think of it like a hidden URL query. It's state you want to keep with a specific location, but you don't want it to be visible in the URL.
UPDATE INSTANCE
INNER JOIN
(SELECT groupid AS group_id,
(SELECT messageid
FROM message
INNER JOIN THREAD ON threadid = message.thread_id
WHERE location_id = @location_id
AND language_id = @language_id
AND concat(group_key, '.') LIKE concat(group.`key`, '.%')
insert 'ice' (registry) succeeded: ice
insert 'ice.pref' (registry) succeeded: ice.pref
insert 'ice.pref.type' (registry) succeeded: ice.pref.type
insert 'ice.pref.type.srv_rflx' (UCHAR) succeeded: 0x64
insert 'ice.pref.type.peer_rflx' (UCHAR) succeeded: 0x6e
import PropTypes from 'prop-types';
import {elementType} from 'prop-types-extra';
import React from 'react';
const INTERCEPT_KEY_CODES = [32, 13]; // enter, space
const propTypes = {
onKeyDown: PropTypes.func,
componentClass: elementType
};
const faker = require('faker');
let array = [];
for ( let i=0; i<100; i++) {
array.push( { name : faker.name.firstName() } );
}