Skip to content

Instantly share code, notes, and snippets.

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

Vladimir E. Koltunov PROGrand

👁️‍🗨️
View GitHub Profile
@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 <[email protected]>
# 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).
@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 / 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 / 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 / FileExtensions.cs
Last active February 20, 2025 01:50
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
{
@TakaoNarikawa
TakaoNarikawa / convert.py
Created April 24, 2020 21:27
Convert darknet pre-trained model to CoreML model
#! /usr/bin/env python
"""
Reads Darknet config and weights and creates Keras model with TF backend.
"""
import argparse
import configparser
import io
import os
@joshdholtz
joshdholtz / UIButton+Block.h
Created April 23, 2012 04:37
iOS - UIButton+Block
//
// UIButton+Block.h
// BoothTag
//
// Created by Josh Holtz on 4/22/12.
// Copyright (c) 2012 Josh Holtz. All rights reserved.
//
#define kUIButtonBlockTouchUpInside @"TouchInside"