Skip to content

Instantly share code, notes, and snippets.

View mavaddat's full-sized avatar
🏠
Working from home

Mavaddat Javid mavaddat

🏠
Working from home
View GitHub Profile
@mavaddat
mavaddat / Part1-ConvertTo-ClassDefinition.ps1
Created May 30, 2023 13:35 — forked from thedavecarroll/Part1-ConvertTo-ClassDefinition.ps1
Creating a Class Definition from an Existing Object - Ironscripter Challenge
#Requires -Version 5.1
function ConvertTo-ClassDefinition {
param(
[Parameter(Position = 0, Mandatory, ValueFromPipeline)]
[object]$Object,
[ValidateNotNullOrEmpty()]
[string]$ClassName,
@mavaddat
mavaddat / download.sh
Last active December 25, 2022 23:49 — forked from mildred/download.sh
Download http://www.ghaemmagham.net/ from archive.org Wayback Machine
#!/bin/bash
url=http://www.ghaemmagham.net/
webarchive=https://web.archive.org
wget="wget -e robots=off -nv"
tab="$(printf '\t')"
additional_url=url.list
# Construct listing.txt from url.list
# The list of archived pages, including some wildcard url
@mavaddat
mavaddat / fish_greeting.fish
Last active November 6, 2022 02:43 — forked from dan-c-underwood/fish_greeting.fish
Custom fish greeting (for fish shell)
function fish_greeting
echo ' '(set_color F00)'___
___======____='(set_color FF7F00)'-'(set_color FF0)'-'(set_color FF7F00)'-='(set_color F00)')
/T \_'(set_color FF0)'--='(set_color FF7F00)'=='(set_color F00)') '(set_color red)(whoami)'@'(hostname)'
[ \ '(set_color FF7F00)'('(set_color FF0)'0'(set_color FF7F00)') '(set_color F00)'\~ \_'(set_color FF0)'-='(set_color FF7F00)'='(set_color F00)')'(set_color yellow)' Uptime: '(set_color white)(uptime | sed 's/.*up \([^,]*\), .*/\1/')(set_color red)'
\ / )J'(set_color FF7F00)'~~ \\'(set_color FF0)'-='(set_color F00)') IP Address: '(set_color white)(hostname -I)(set_color red)'
\\\\___/ )JJ'(set_color FF7F00)'~'(set_color FF0)'~~ '(set_color F00)'\) '(set_color yellow)'Version: '(set_color white)(echo $FISH_VERSION)(set_color red)'
\_____/JJJ'(set_color FF7F00)'~~'(set_color FF0)'~~ '(set_color F00)'\\
'(set_color FF7F00)'/ '(set_color FF0)'\ '(set_color FF0)', \\'(set_color F00)'J'(set_color
@mavaddat
mavaddat / cue_to_mp3.py
Last active August 11, 2022 05:25 — forked from bancek/cue_to_mp3.py
CUE splitter using ffmpeg (to mp3)
from slugify import slugify
cue_file = r'''C:/Users/mavad/Downloads/Philip Glass - Akhnaten/CD1/Philip Glass - Akhnaten (CD1).cue'''
d = open(cue_file).read().splitlines()
general = {}
tracks = []
current_file = None
function Get-ConsoleAsHTML
{
[CmdletBinding()]
param (
)
#
# The script captures console screen buffer up to the current cursor position and returns it in HTML format.
#

Registering an Application to a URI Scheme

  • Article
  • 07/13/2016
  • 5 minutes to read

The About Asynchronous Pluggable Protocols article describes how to develop handlers for Uniform Resource Identifier (URI) schemes. In some cases, it may be desirable to invoke another application to handle a custom URI scheme. To do so, register the existing application as a URI pluggable protocol handler and associate it with the custom URI scheme. Once the application has successfully launched, it can use command-line parameters to retrieve the URI that launched it. These settings apply to pluggable protocol handlers launched from within Windows Internet Explorer and from Windows Explorer using the Run... command (Windows logo key

@mavaddat
mavaddat / 1b8b0ca5e8737235dccd.md
Last active January 24, 2022 19:39 — forked from yano3nora/docker_mail_servers.md
[docker: Mail server container] Mail servers by Docker. #docker

About Mail Hog

It is a kind of simple SMTP server and can be used for mail test during development. Because the container is also published on Docker Hub It's also very easy to deploy.

This time, we will just add an SMTP server to the existing docker project. If you want to check the behavior with docker run, please check the document of the distributor.

Installation method

@mavaddat
mavaddat / powershell_github_auth.ps1
Last active January 19, 2022 21:23 — forked from majorsilence/powershell_github_basic_auth.ps1
Powershell - Github Api - List Pull Requests - Basic Authentication
# See https://developer.github.com/v3/pulls/#list-pull-requests
# https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
# If using token...
$ghcred = Get-Credential -Message "Please provide your username and GitHub token" -Title "Github Personal Access Token"
$headers = @{"Authorization"="token $($ghcred.Password | ConvertFrom-SecureString -AsPlainText)"}
# Else if using basic
@mavaddat
mavaddat / .bashrc
Last active January 22, 2022 03:10 — forked from glsorre/keychain.ps1
Windows git and Windows Subsystem for Linux will never prompt ssh passphrase again
# To avoid having to re-type the password for SSH
test -f /usr/bin/keychain && eval $(/usr/bin/keychain --eval --quiet id_rsa)
@mavaddat
mavaddat / google-passwords-delete.js
Last active May 4, 2022 04:36 — forked from captchadex/google-passwords-delete.js
Google Chrome password deleter
// Run this in chrome://settings/passwords
// Works as of Chrome Version 102.0.5005.27
// check if we are at chrome://settings/passwords
if (document.location.href.indexOf("chrome://settings/passwords") == -1) {
console.info("Navigating to chrome://settings/passwords");
document.location.href = "chrome://settings/passwords";
}
const delay = 333;
setInterval(() => {