Skip to content

Instantly share code, notes, and snippets.

View iobajwa's full-sized avatar

Bhavnit Singh Bajwa iobajwa

View GitHub Profile
@iobajwa
iobajwa / ProcessAsyncHelper.cs
Created April 7, 2020 17:13 — forked from AlexMAS/ProcessAsyncHelper.cs
The right way to run external process in .NET (async version)
using System;
using System.Diagnostics;
using System.Text;
using System.Threading.Tasks;
public static class ProcessAsyncHelper
{
public static async Task<ProcessResult> ExecuteShellCommand(string command, string arguments, int timeout)
{
var result = new ProcessResult();
@iobajwa
iobajwa / git-tag-delete-local-and-remote.sh
Created May 31, 2019 14:51 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@iobajwa
iobajwa / count_total_project_code_lines_in_sublime
Last active April 13, 2018 15:07 — forked from Hexodus/count_total_project_code_lines_in_sublime
Count total code lines in project using Sublime texteditor
// Go to menue:
// find->find in files
// Switch on reg_ex button
// Find:
^(.*)$
// Where:
c:\your_folder\,*.php,*.phtml,*.js,*.inc,*.html, -*/folder_to_exclude/*
// Then click on the find button
// Be careful to not click on Replace!!!
[
{ "keys": ["ctrl+alt+o"], "command": "open_dir",
"args": {"dir": "$file_path", "file": "$file_name"} },
{ "keys": ["ctrl+shift+o"], "command": "prompt_open_folder" },
{ "keys": ["ctrl+'"], "command": "reveal_in_side_bar" },
{ "keys": ["ctrl+alt+p"], "command": "prompt_select_workspace" },
]
@iobajwa
iobajwa / expecting.md
Created March 7, 2018 06:15 — 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