Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Inomdzhon Mirdzhamolov inomdzhon

🏠
Working from home
View GitHub Profile
View Android_Studio_emulator.md

Android Studio emulator (Mac OS)

emulator-commandline documentation

For first download Android Studio.

Quick start

For start emulator

View a-task.md

Задание

Описание

Матрицу можно представить в виде двумерного списка. Например, список [[1, 2, 3], [4, 5, 6], [7, 8, 9]] — это отображение матрицы:

1 2 3
4 5 6
7 8 9
View collectIncorrectAnswersAndCopyToBuffer.js
function collectIncorrectAnswersAndCopyToBuffer(withSpoiler) {
const elsList = document.querySelector('main > ol');
function getAnswerFromStorage(key) {
const value = localStorage.getItem(key);
if (!value) {
return 'Unknown';
}
View clearEventListener.js
// TODO check to `passive` param
function clearEventListener(target) {
var listeners = getEventListeners(target);
for (const key in listeners) {
if (!listeners.hasOwnProperty(key)) {
continue;
}
View ts-non-relative-path-problem.md

Прелюдия

Назовём пакет example.

tsconfig.json

{
  "compilerOptions": {
    "baseUrl": "src",
    "jsx": "react",
View fix_ios_controls.css
button,
html input[type="button"],
input[type="reset"] {
  border: none;
  -webkit-appearance: none;
  cursor: pointer;
}
button[disabled],
html input[disabled] {
View hoc_typing.md

HOC typing

Typesciprt

function higherOrderFn<T extends (...args: any[]) => any>(fn: T): (...args: Parameters<T>) => ReturnType<T> {
  return (...args: Parameters<T>) => {
    return fn(args);
  };
}
View onlyNumber.js
// other way
function isNumber(evt) {
evt = (evt) ? evt : window.event;
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
return false;
}
return true;
}
View validateHashtags.js
const validateMethods = {
noMeta: function (arrayHashtag) {
return arrayHashtag.some((hashtag) => hashtag.trim() === '#');
},
countExceeded: function (arrayHashtag, maxCount) {
return arrayHashtag.length > maxCount;
},
lengthExceeded: function (arrayHashtag, maxLength) {