Skip to content

Instantly share code, notes, and snippets.

View pekhota's full-sized avatar

Oleksandr Piekhota pekhota

  • Teaching Strategies, LLC
  • Edinburgh
View GitHub Profile
@pekhota
pekhota / git_alias_setup
Created October 31, 2023 10:47
One liner to setup git aliases
# Basic Git Aliases
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.lg "log --oneline --decorate --all --graph"
@pekhota
pekhota / .bash-functions
Created July 19, 2023 19:03
Gets the full path to the file
path() {
local filename="$1"
local search_dir="$2"
if [ -z "$filename" ]; then
echo "Error: Filename argument is missing."
return 1
fi
if [ -z "$search_dir" ]; then
@pekhota
pekhota / .vimrcc
Created July 5, 2023 14:27
.vimrcc default file
set number
syntax on
colorscheme industry
set tabstop=4
set autoindent
set expandtab
set softtabstop=4
set cursorline
brew install --cask 1password
brew install --cask termius
brew install --cask dropbox
brew install --cask docker
brew install --cask numi
# utils
brew install --cask alfred
brew install --cask cleanshot
brew install --cask rectangle-pro
#/bin/bash
set -e
#
# Downloads latest releases (not pre-release) runner
# Configures as a service
#
# Original: https://raw.githubusercontent.com/actions/runner/automate/scripts/create-latest-svc.sh
#
@pekhota
pekhota / README-Template.md
Created April 20, 2020 15:00 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@pekhota
pekhota / docker-compose.yml
Created April 7, 2020 16:35
Good starting docker-compose for laravel project
version: "3.7"
services:
# todo run as non root user
nginx:
# using alpine for better image size
# using exact version for backward compatibility
# https://hub.docker.com/_/nginx
image: "nginx:1.17.9-alpine"
volumes:
- ./docker/nginx/server.conf:/etc/nginx/conf.d/default.conf
@pekhota
pekhota / expecting.md
Created September 22, 2018 14:02 — forked from ksafranski/expecting.md
Basic principles of using tcl-expect scripts

Intro

TCL-Expect scripts are an amazingly easy way to script out laborious tasks in the shell when you need to be interactive with the console. Think of them as a "macro" or way to programmaticly step through a process you would run by hand. They are similar to shell scripts but utilize the .tcl extension and a different #! call.

Setup Your Script

The first step, similar to writing a bash script, is to tell the script what it's executing under. For expect we use the following:

#!/usr/bin/expect
@pekhota
pekhota / callback-example.php
Created January 4, 2018 14:32
Пример того, как можно собирать метрики в едином месте.
<?php
function do($msg, callable $cb, array $params = []) {
$executionStartTime = microtime(true);
$result = call_user_func_array($cb, $params);
$executionEndTime = microtime(true);
$seconds = $executionEndTime - $executionStartTime;
@pekhota
pekhota / GroupOfExceptions.php
Created December 26, 2017 17:46
Быстрая telegram интеграция
<?php
namespace App\Exceptions;
use Throwable;
class GroupOfExceptions extends \RuntimeException
{