Skip to content

Instantly share code, notes, and snippets.

@ishu3101
ishu3101 / gist_to_github_repo.md
Created November 24, 2015 08:35
Transfer a gist to a GitHub repository

Transfer a gist to a GitHub repository

clone the gist

git clone https://gist.github.com/ishu3101/6fb35afd237e42ef25f9

rename the directory

mv 6fb35afd237e42ef25f9 ConvertTo-Markdown

change the working directory to the newly renamed directory

cd ConvertTo-Markdown

@ishu3101
ishu3101 / read_arguments.js
Last active March 12, 2024 18:10
Accept input via stdin and arguments in a command line application in node.js
#!/usr/bin/env node
var args = process.argv.slice(2);
var input = args[0];
var isTTY = process.stdin.isTTY;
var stdin = process.stdin;
var stdout = process.stdout;
// If no STDIN and no arguments, display usage message
@ishu3101
ishu3101 / .gitlab-ci.yml
Created June 8, 2017 07:27
Run PowerShell Command/Script from a .gitlab-ci.yml file on a gitlab.com using the Gitlab CI
image: philippheuer/docker-gitlab-powershell
test:
stage: test
script:
# run PowerShell script
- powershell -File build.ps1
# run PowerShell Command
- powershell -Command "Get-Date"
@ishu3101
ishu3101 / sample-resume.json
Last active January 31, 2024 22:57
Sample Resume in JSON Resume Format
{
"basics": {
"name": "Your first and last name",
"label": "",
"picture": "",
"email": "Your email address",
"phone": "A phone number, with any formatting you like. E.g. (555) 555-5555.",
"degree": "",
"website": "Your website URL",
"summary": "A one-sentence to one-paragraph overview text. Do not include any line-breaks.",
@ishu3101
ishu3101 / Get-Computer-Info.ps1
Created September 28, 2022 01:52
How to Get Computer Information such as CPU, Manufacturer, Model, OS etc using Powershell
# Get Free & Total Disk Space
Get-WmiObject -Class win32_logicaldisk -ComputerName $computerName | ft DeviceID, @{Name="Free Disk Space (GB)";e={$_.FreeSpace /1GB}}, @{Name="Total Disk Size (GB)";e={$_.Size /1GB}} -AutoSize
# Get Computer Model
Get-ComputerInfo | Select -ExpandProperty CsModel
# Get OS
Get-ComputerInfo | Select WindowsProductName
@ishu3101
ishu3101 / Get-InstalledPrograms.ps1
Created September 26, 2022 23:24
Get the List of Installed Program via Registry using Powershell
Function Get-InstalledPrograms {
<#
.Synopsis
Fetches the list of installed software on a system via the Windows Registry.
.Description
Returns a list of software installed on a system determined from installations that have
registered themselves in the Windows Registry. This cmdlet will parse both the native key
and the WOW64 key if it exists to ensure a complete list of software installs is returned.
.Notes
This cmdlet is particularly useful on Server Core installations where the Programs and
@ishu3101
ishu3101 / color.md
Created March 20, 2020 05:53
What each Color Reflects
Color Reflects
Greyscale Power, elegance, reliability, intelligence, modesty, maturity, functionality, and formality
Blue Depth and stability, trust, loyalty, wisdom, confidence, intelligence, faith, truth, heaven, tranquility and calmness
Teal Creativity, inspiration, credibility, reliability, spiritual development
Green Nature, growth, harmony, freshness, fertility, safety, healing, money
Purple Royalty, power, nobility, luxury, ambition, wealth, extravagance, wisdom, dignity, independence, creativity, mystery, and magic
Pink Girly, sweet, innocent, sensitive, passionate, playful, sensual and loving
Red Power, energy, passion, desire, speed, strength, love, fire, intensity, and celebration
Orange Joy, enthusiasm, fascination, happiness, creativity, determination, attraction, success, encouragement, and stimulation
@ishu3101
ishu3101 / Get-ComputerInfo.ps1
Created September 26, 2022 22:15
Get Computer Information such as OS, Manufacturer, Model, CPU using Powershell
$osInfo = Get-CimInstance Win32_OperatingSystem
$computerInfo = Get-CimInstance Win32_ComputerSystem
$diskInfo = Get-CimInstance Win32_LogicalDisk
$cpuinfo = Get-WmiObject Win32_Processor
[hashtable]$objectProperty = @{}
$objectProperty = [ordered]@{
ComputerName = $computerInfo.Name
OS = $osInfo.Caption + " $($osInfo.OSArchitecture)"
@ishu3101
ishu3101 / loop_string.pl
Created June 7, 2016 00:53
3 ways to loop through each character in a string in Perl
# 3 ways to loop through each character in a string
$text = "hello world";
for $i (0..length($text)-1){
$char = substr($text, $i, 1);
print "Index: $i, Text: $char \n";
}
foreach $char (split //, $text) {
@ishu3101
ishu3101 / google-translate-selected-text-bookmarklet.js
Created May 16, 2013 05:57
A Bookmarklet that translates the selected text into english using the translate.google.com and displays the translated text in a new tab.
javascript:void(window.open("http://translate.google.com/#auto|en|" +document.getSelection()))