Skip to content

Instantly share code, notes, and snippets.

View mhamri's full-sized avatar
🏸
Converting Knowledge to Wisdom

Mohammad Hossein Amri mhamri

🏸
Converting Knowledge to Wisdom
View GitHub Profile
@mhamri
mhamri / settings.json
Created August 16, 2022 16:38
terminal
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "copy",
"singleLine": false
@mhamri
mhamri / Microsoft.PowerShell_profile.ps1
Created August 16, 2022 16:36
powershell with posh and update-packages command
Import-Module posh-git
Import-Module oh-my-posh
Set-Theme Paradox
function Update-Packages {
# Push-Location
# $node_version = node -v
# $node_path = "$env:appdata\nvm\$node_version"
# Write-Host "node_version: $node_version"
@mhamri
mhamri / ssh-to-colab.ipynb
Last active April 5, 2024 07:57
Open SSH in colab.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mhamri
mhamri / Move-GitFolder.ps1
Last active August 19, 2021 03:59
git mv any folder with it's sub folder to another folder in windows powershell
# git mv a folder and sub folders in windows
function Move-GitFolder {
param (
$target,
$destination
)
if (Test-Path $target -PathType Leaf){
@mhamri
mhamri / copyFileFilter.ps1
Created December 10, 2019 04:36
a powershell script to copy only a set of extension with ability to filter
$SourceFolderPath = 'C:\repo\PPMS'
$FinalFolderPath = 'C:\repo\PPMSF'
# Get existing files into arrays:
$SourceObjects = Get-ChildItem -Path $SourceFolderPath -Recurse -Include ("*.js", "*.ts", "*.html", "*.cs", "*.cshtml","*.ts", "*.json" , "*.svg", "*.css", "*.scss", "*.csproj", "*.dcproj", "*.gif", "*.sh", "*.yml", "*.bat", "*.ps1", "*.jpg", "*.jpeg", "*.png" )
# $FinalObjects = Get-ChildItem -Path $FinalFolderPath -Recurse
# $hash=@{}
# Loop all files in the source folder:
@mhamri
mhamri / FindInvalidCharacterInEnvironment.cs
Last active May 18, 2019 18:30
find any invalid character in the PATH environment variable
using System;
using System.Collections;
using System.Linq;
using System.Linq.Expressions;
using System.Collections.Generic;
using System.Text;
namespace FindInvalidCharacterInEnvironment
{