Skip to content

Instantly share code, notes, and snippets.

@ishu3101
ishu3101 / rss-to-json-bookmarklet.js
Created September 2, 2016 03:42
Bookmarklet: Convert RSS Feed to JSON
javascript:void(window.open("http://rss2json.com/api.json?rss_url="+window.location.href))
@ishu3101
ishu3101 / powershell-install-ubuntu.sh
Last active June 12, 2019 10:49
Install PowerShell on Ubuntu 14.04
# install Powershell on Ubuntu 14.04
curl -SL https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.2/powershell_6.0.0-beta.2-1ubuntu1.14.04.1_amd64.deb -o powershell_6.0.0-beta.2-1ubuntu1.14.04.1_amd64.deb
sudo apt-get install libunwind8 libicu52
sudo dpkg -i powershell_6.0.0-beta.2-1ubuntu1.14.04.1_amd64.deb
@ishu3101
ishu3101 / reset-wsl.sh
Created July 22, 2016 23:38
Resetting your Windows Subsystem for Linux (WSL) Environment
# Resetting your Windows Subsystem for Linux (WSL) Environment
lxrun.exe /uninstall /full
lxrun.exe /install
@ishu3101
ishu3101 / github_repo.html
Created July 7, 2016 09:36
Sort Public Repository on Github by the number of stars
{% if site.github.public_repositories %}
{% assign sorted_repositories = site.github.public_repositories | sort: 'stargazers_count' %}
{% for repository in sorted_repositories reversed %}
<h2><a href="{{ repository.html_url }}" target="_blank">{{ repository.name }}</a></h2>
<p>{{ repository.description }}</p>
{% endfor %}
{% endif %}
@ishu3101
ishu3101 / project.json
Last active September 25, 2016 23:34
Project Metadata
[
{
"name": "shortn",
"description": "Shorten URL using bitly, tinyurl & more using the command line",
"website": "https://github.com/ishu3101/shortn",
"language": "python"
},
{
"name": "Copy URL & Title",
"description": "Chrome Extension to copy URL, title of current tabs & windows",
@ishu3101
ishu3101 / read_args.py
Created July 6, 2016 01:06
Read CSV data as Input either using STDIN or as Command Line Argument using Python
import sys
import csv
try:
if (sys.argv[1] == '-'):
f = sys.stdin.read().splitlines()
else:
filename = sys.argv[1]
f = open(filename, 'r')
csv = csv.reader(f)
@ishu3101
ishu3101 / stdin.py
Created July 6, 2016 00:42
Read input either from stdin or as command line argument using Python.
import sys
import fileinput
for line in fileinput.input(sys.argv[1:]):
print line.strip().upper()
@ishu3101
ishu3101 / links_format.md
Created June 27, 2016 07:21
Insert Links in different Formats. Markdown, HTML, Textile, AsciiDoc, ReStructuredText, BBCode & Latex.
function Get-OutDatedModule(){
$loadedModules = Get-Module
foreach ($module in $loadedModules) {
$foundModule = Find-Package -Name $module.Name -ErrorAction SilentlyContinue
if ($foundModule) {
if ($module.Version -lt $foundModule.Version) {
Write-Host "$($module.Name): Installed version: $($module.Version.ToString()) - Newest version: " -NoNewline
Write-Host "$($foundModule.Version.ToString())" -ForegroundColor Red
}
}
@ishu3101
ishu3101 / multiple_value_dictionary.pl
Last active June 7, 2016 02:23
Dictionary (also called Hashes, Associative Array or Maps) with Single Key and Multiple Values Example in Perl
%letters = (
"a" => ["Apple", "Aeroplane"],
"b" => ["Bat", "Banana", "Basket"],
"c" => ["Cat", "Carpet"],
);
# loop through just the keys
for my $key (sort keys %letters){
$value = $letters{$key};
$length = @{$value};
print "Key: $key \n";