Skip to content

Instantly share code, notes, and snippets.

View yauhenipakala's full-sized avatar
🎯
Focusing

Yauheni Pakala yauhenipakala

🎯
Focusing
View GitHub Profile
@Arlodotexe
Arlodotexe / unflatten-namespaces.ps1
Last active September 13, 2022 11:03
PowerShell script to unflatten and nest the namespaces in a standard DocFx toc.yaml
#####################################
# About
#####################################
# This is a PowerShell port of Aaron Bernstein's NodeJS code by Arlo Godfrey.
# Unflattens and nests the namespaces in a standard DocFx toc.yaml
# Source: https://github.com/dotnet/docfx/issues/274#issuecomment-456168196
# Last updated 5/14/2022.
# Licensed under MIT.
#####################################
@wildcard
wildcard / ya.py
Last active May 13, 2025 09:44 — forked from Yegorov/ya.py
Download file from Yandex.Disk through share link for large file + reconnect option on MacOS with caffeinate to prevent computer from sleep
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# https://toster.ru/q/72866
# How to
# wget http://gist.github.com/...
# chmod +x ya.py
# ./ya.py download_url path/to/directory
import os, sys, json
@creativecreatorormaybenot
creativecreatorormaybenot / OpacityHex.markdown
Last active November 11, 2025 13:50 — forked from passiondroid/OpacityHex.markdown
Opacity Percentage to Flutter Opacity Hex Color code

Flutter uses hexadecimal ARGB values for colors, which are formatted as const Color(0xAARRGGBB). That first pair of letters, the AA, represent the alpha channel. You must convert your decimal opacity values to a hexadecimal value. Here are the steps:

Alpha Hex Value Process

  • Take your opacity as a decimal value and multiply it by 255. So, if you have a block that is 50% opaque the decimal value would be .5. For example: .5 x 255 = 127.5

  • The fraction won't convert to hexadecimal, so you must round your number up or down to the nearest whole number. For example: 127.5 rounds up to 128; 55.25 rounds down to 55.

  • Enter your decimal value in a decimal-to-hexadecimal converter, like http://www.binaryhexconverter.com/decimal-to-hex-converter, and convert your values.

@huzaifaarain
huzaifaarain / Docker-LAMP.md
Last active February 20, 2023 10:59
Minimal Docker Setup for PHP, MySQL & PhpMyAdmin

Minimal Docker Setup PHP, MySQL & phpmyadmin

Install docker

sudo apt install docker docker-compose

Navigate to your desire directory and Clone the repository

@cronfy
cronfy / dl-cloud-mail-ru.sh
Last active June 30, 2025 09:31
Download file from cloud.mail.ru from linux console with bash script
#!/usr/bin/env bash
# Скрипт по загрузке публичных файлов с Облака mail.ru. Поддерживается докачка.
# v1.0.5 от 2022-05-30
#
# ЕСЛИ СКРИПТ НЕ РАБОТАЕТ
#
# 1. Убедитесь, что файл доступен публично. Возможна загрузка только публичных файлов.
# 2. Mail.ru время от времени меняет внутрянку, не очень сильно, но требуется адаптация скрипта.
# Если скрипт не работает, просьба сделать работающий форк и скинуть ссылку в комментарии.

Async and Await: Here be dragons

Overview

  • Background
  • Basics
  • Concepts
  • Examples

In the Beginning …

@mihow
mihow / load_dotenv.sh
Last active November 21, 2025 08:36
Load environment variables from dotenv / .env file in Bash
# The initial version
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
# My favorite from the comments. Thanks @richarddewit & others!
set -a && source .env && set +a
@0xjac
0xjac / private_fork.md
Last active November 22, 2025 14:11
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

@thorsten
thorsten / setUserAgent.js
Created May 9, 2016 15:12
Override user agent on all browsers
function setUserAgent(window, userAgent) {
// Works on Firefox, Chrome, Opera and IE9+
if (navigator.__defineGetter__) {
navigator.__defineGetter__('userAgent', function () {
return userAgent;
});
} else if (Object.defineProperty) {
Object.defineProperty(navigator, 'userAgent', {
get: function () {
return userAgent;
@Spencer-Easton
Spencer-Easton / exportSpreadsheet.gs
Last active July 8, 2025 10:31
Example on how to export a Google sheet to various formats, includes most PDF options
function exportSpreadsheet() {
//All requests must include id in the path and a format parameter
//https://docs.google.com/spreadsheets/d/{SpreadsheetId}/export
//FORMATS WITH NO ADDITIONAL OPTIONS
//format=xlsx //excel
//format=ods //Open Document Spreadsheet
//format=zip //html zipped