Skip to content

Instantly share code, notes, and snippets.

@ishu3101
ishu3101 / multiple_value_dictionary.cs
Last active January 16, 2021 22:14
Dictionary with Single Key and Multiple Values Example in C#. See https://repl.it/CY3S/1 to run example code online.
using System;
using System.Collections.Generic;
class MainClass {
public static void Main (string[] args) {
Dictionary<string, List<String>> map = new Dictionary<string, List<String>>();
// create list one and store values
List<string> valSetOne = new List<string>();
@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 / I'm-Feeling-Lucky-Google-Search-Bookmarklet.js
Created May 16, 2013 05:51
A Bookmarklet that takes the selected text and does the I'm Feeling Lucky Google Search in the new tab. ie: Opens the first result page when you do a Google Search with the text that was selected.
javascript:void(window.open("http://www.google.com/search?q="+document.getSelection()+"&btnI=I'm+Feeling+Lucky"))
@ishu3101
ishu3101 / packer_setup.sh
Created November 2, 2018 21:11
Install Packer on Ubuntu 16.04
curl -SL https://releases.hashicorp.com/packer/1.3.2/packer_1.3.2_linux_amd64.zip -o packer_1.3.2_linux_amd64.zip
unzip packer_1.3.2_linux_amd64.zip
sudo mv packer /usr/bin/packer
@ishu3101
ishu3101 / setup_aws-vault.sh
Created March 3, 2020 04:11
Install AWS Vault on Linux
curl -SL https://github.com/99designs/aws-vault/releases/download/v5.3.2/aws-vault-linux-amd64 -o aws-vault
sudo mv aws-vault /usr/bin/aws-vault
chmod +x /usr/bin/aws-vault
@ishu3101
ishu3101 / sync_gitbranch.sh
Created February 24, 2016 05:33
Git: Keep gh-pages branch up to date (sync) with the master branch
git add .
# see what changes are going to be commited
git status
git commit -m 'Some descriptive commit message'
git push origin master
# go to the gh-pages branch
git checkout gh-pages
# bring gh-pages up to date with master
git rebase master
@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 / run_usage.md
Last active January 3, 2019 10:37
Running Code in different languages, frameworks in [Cloud9](C9.io)

jekyll

jekyll serve --port $PORT --host $IP

hugo

hugo server -w --port=$PORT --bind=$IP

hexo

hexo server -p $PORT -i $IP

python

[
{
"quote": "In a crowded marketplace, fitting in is failing. In a busy marketplace, not standing out is the same as being invisible.",
"author": "Seth Godin",
"source": "https://www.amazon.com/Purple-Cow-New-Transform-Remarkable/dp/1591843170"
},
{
"quote": "It’s counterintuitive, but the way to grow your business is to focus entirely on your existing customers. Just thrill them, and they’ll tell everyone",
"author": "Derek Sivers",
"source": "https://www.amazon.com/Anything-You-Want-Lessons-Entrepreneur/dp/1511366079",
@ishu3101
ishu3101 / install_nanobox.sh
Created October 13, 2018 22:15
Install Nanobox and Docker CE on Ubuntu 18.04
# Script to install nanobox and docker-ce
# install Nanobox
curl -SL https://d1ormdui8qdvue.cloudfront.net/installers/v2/linux/nanobox_2_amd64.deb -o nanobox_2_amd64.deb
sudo dpkg -i nanobox_2_amd64.deb
# install docker ce
# Environment variables you need to set so you don't have to edit the script below.
export DOCKER_CHANNEL=edge