Skip to content

Instantly share code, notes, and snippets.

View PROGrand's full-sized avatar
👁️‍🗨️

Vladimir E. Koltunov PROGrand

👁️‍🗨️
View GitHub Profile
@PROGrand
PROGrand / GITLFSMIGRATE.MD
Last active April 29, 2021 13:01
Migrate git files to lfs

Git + lfs

  • Track file as lfs:
$ git lfs track "*.psd"
  • Migrate files after add to lfs .gitattributes: $ git lfs migrate import --everything$(awk '/filter=lfs/ {printf " --include='''%s'''", $1}' .gitattributes)
@PROGrand
PROGrand / click_dropdown.dart
Created September 21, 2021 00:35
Gherkin step definition for dropdown control
import 'package:flutter_gherkin/flutter_gherkin.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:gherkin/gherkin.dart';
final givenITapDropdownItem = given2<String, String, FlutterWorld>(RegExp(r'I tap (?:a|an|the) {string} within (?:a|an|the) {string} dropdown'), (menuItemKey, dropdownKey, context) async {
await context.world.appDriver.waitForAppToSettle();
final finder = context.world.appDriver.findBy(dropdownKey, FindType.key);
await context.world.appDriver.scrollIntoView(
finder,
@PROGrand
PROGrand / FileExtensions.cs
Last active July 6, 2024 02:17
Enable file extensions view in Unity Project window.
using UnityEditor;
using UnityEngine;
using System.IO;
using System.Text;
using System.Collections.Generic;
using System.Reflection;
[InitializeOnLoad]
public class FileExtensionGUI
{
@PROGrand
PROGrand / ExampleController.cs
Last active April 16, 2024 21:45
SwaggerResponse and ProducesResponseType attributes checking
[ApiController]
[Route("[controller]")]
public class ExampleController : ControllerBase
{
// SwaggerResponse supported, i prefer old one.
[HttpGet]
[SwaggerOperation("LoginUser")]
[SwaggerResponse(statusCode: StatusCodes.Status200OK, type: null, description: "signed user email account")]
[SwaggerResponse(statusCode: StatusCodes.Status400BadRequest, type: null, description: "wrong email or password")]
[Route("/users/login")]
@PROGrand
PROGrand / get_linux_memory.sh
Created June 2, 2022 08:41
How to get linux memory distribution per process
#!/bin/sh
ps -eo size,pid,user,command --sort -size | \
awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' |\
cut -d "" -f2 | cut -d "-" -f1 | less
@PROGrand
PROGrand / OpenCore Hotkeys.md
Last active July 16, 2024 16:22
OpenCore Hotkeys

OpenCore Hotkeys

Startup Screen

  • OPT — show OpenCore menu. Also Esc is supported.
  • CMD+OPT+P+R — clear NVRAM. Required: Misc-Security-AllowNvramReset=YES.
  • X — load first founded Apple system, if no Apple os is marked as default.
  • CMD+R — load in (Recovery).
  • CMD+C+MINUS — turn of board-id compatibility check.
  • CMD+K — actual core loading, analog of kcsuffix=release.
@PROGrand
PROGrand / test_dump.md
Created December 5, 2022 23:42
Flutter: how to solve timeout on tester.pumpAndSettle()

Just insert it before bad tester.pumpAndSettle() and analyze output.

  await TestAsyncUtils.guard<int>(() async {
    final DateTime endTime =
        tester.binding.clock.fromNowBy(Duration(seconds: 30));
    int count = 0;
    do {
      if (tester.binding.clock.now().isAfter(endTime)) {
        break;
@PROGrand
PROGrand / wsl2-network-speed
Last active March 30, 2023 22:53
WSL2 network speed
For those having slow wsl2 network speed on windows11.
https://github.com/microsoft/WSL/issues/4901#issuecomment-1489783550
@PROGrand
PROGrand / .git-prompt.sh
Last active July 11, 2023 10:34
Add git prompt support for MacOS
# bash/zsh git prompt support
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Distributed under the GNU General Public License, version 2.0.
#
# This script allows you to see repository status in your prompt.
#
# To enable:
#
# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh).