Skip to content

Instantly share code, notes, and snippets.

@ishu3101
ishu3101 / gist_to_github_repo.md
Created Nov 24, 2015
Transfer a gist to a GitHub repository
View gist_to_github_repo.md

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 / programming_quote.py
Created May 29, 2017
Generate a Random Programming Quote using an API
View programming_quote.py
#!/usr/bin/python
import urllib
import urllib2
import random
import json
# get a random programming quote using an api
url="http://quotes.stormconsultancy.co.uk/random.json"
View web_searches.csv
google https://www.google.com/search?q={query}
google lucky https://www.google.co.nz/search?q={query}&btnI
google image https://www.google.com/search?q={query}&tbm=isch
duckduckgo https://duckduckgo.com/?q={query}
bing https://www.bing.com/search?q={query}
yahoo http://www.search.yahoo.com/search?p={query}
wikipedia http://en.wikipedia.org/wiki/{query}
youtube http://www.youtube.com/results?search_query={query}
facebook http://www.facebook.com/search/?q={query}
twitter https://twitter.com/search?q={query}
View ios-filesystem
Here's a list of the most common folders in the iOS file system. Please note, if your device is still jailed you are NOT able to see these folders.
/Applications
This is where pre-installed native apps and jailbreak apps are installed.
/Library/Ringtones
This is where the pre-installed ringtones are stored. User-purchased ringtones are placed in /private/var/mobile/Media/Ringtones
/Library/Wallpaper
This is where Wallpapers and Lockscreens are stored.
@ishu3101
ishu3101 / read_arguments.js
Last active May 29, 2021
Accept input via stdin and arguments in a command line application in node.js
View read_arguments.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 / loop_string.pl
Created Jun 7, 2016
3 ways to loop through each character in a string in Perl
View loop_string.pl
# 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 / reset-wsl.sh
Created Jul 22, 2016
Resetting your Windows Subsystem for Linux (WSL) Environment
View reset-wsl.sh
# Resetting your Windows Subsystem for Linux (WSL) Environment
lxrun.exe /uninstall /full
lxrun.exe /install
@ishu3101
ishu3101 / sample-resume.json
Last active Feb 3, 2021
Sample Resume in JSON Resume Format
View sample-resume.json
{
"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 / multiple_value_dictionary.cs
Last active Jan 16, 2021
Dictionary with Single Key and Multiple Values Example in C#. See https://repl.it/CY3S/1 to run example code online.
View multiple_value_dictionary.cs
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 Jul 6, 2016
Read CSV data as Input either using STDIN or as Command Line Argument using Python
View read_args.py
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)