Skip to content

Instantly share code, notes, and snippets.

View bestwebdeveloper's full-sized avatar

Vladimir Tcvetkov bestwebdeveloper

View GitHub Profile
@neoRiley
neoRiley / AspectRatioButton.cs
Last active April 10, 2024 23:08
Extends VisualElement and provides the ability to maintain an aspect ratio as well as add a Label who's font size is scaled with the AspectRatioPanel
using System;
using System.Collections.Generic;
using UniRx;
using UnityEngine;
using UnityEngine.UIElements;
namespace N30R1L37
{
[UnityEngine.Scripting.Preserve]
#!/usr/bin/env bash
set -e
target_osx=$(sw_vers -productVersion)
project_dir=/Users/rkmax/development/aseprite
skia_dir=/Users/rkmax/development/skia
arch="$(uname -m)"
bundle_trial_url=https://www.aseprite.org/downloads/trial/Aseprite-v1.2.40-trial-macOS.dmg
@codorizzi
codorizzi / HorizontalOrVerticalLayoutGroupEditor.cs
Last active April 18, 2024 03:42
Unity - Smooth Layout Group (using DoTween)
using UnityEditor;
using UnityEngine;
namespace Utility.SLayout {
[CustomEditor(typeof(SHorizontalOrVerticalLayoutGroup), true)]
[CanEditMultipleObjects]
/// <summary>
/// Custom Editor for the HorizontalOrVerticalLayoutGroupEditor Component.
/// Extend this class to write a custom editor for a component derived from HorizontalOrVerticalLayoutGroupEditor.
/// </summary>
@pbhogan
pbhogan / AspectRatioPanel.cs
Last active April 7, 2024 03:12
Unity UI-Toolkit Aspect Ratio Preserving Panel
/*
This is free and unencumbered software released into the public
domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors

Принципы разработки Амплифера

Тут перечислены не законы, последние слово всегда за здравым смыслом. Тут перечислены лишь направление, куда надо стремиться. Принципы, которые должны помочь, когда не знаешь, что выбрать.

Ценности

  1. Пользователь. Если что-то сильно мешает UX или есть критическая ошибка, то в первую очередь мы спасаем пользователей. Для этого иногда надо взять ответственность на себя, переубедить толпу, написать плохой код.
@zmts
zmts / debian.md
Last active October 1, 2020 07:05
Первичная настойка Debian Linux (безопасность, права, полезные утилиты)

Первичная настойка Debian Linux (хост для сайтов)

Для начала

Загрузить и установить последние обновления системы

apt update
apt upgrade
reboot
@zmts
zmts / tokens.md
Last active April 23, 2024 09:58
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active April 15, 2024 02:19
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@paulirish
paulirish / what-forces-layout.md
Last active April 24, 2024 12:47
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@nhagen
nhagen / PromisAllWithFails.js
Last active November 15, 2022 18:11
Wait until all promises have completed even when some reject, with Promise.all
var a = ["sdfdf", "http://oooooolol"],
handleNetErr = function(e) { return e };
Promise.all(fetch('sdfdsf').catch(handleNetErr), fetch('http://invalidurl').catch(handleNetErr))
.then(function(sdf, invalid) {
console.log(sdf, invalid) // [Response, TypeError]
})
.catch(function(err) {
console.log(err);
})