Skip to content

Instantly share code, notes, and snippets.

View ProProgrammer's full-sized avatar

Deep Sukhwani ProProgrammer

View GitHub Profile
@ProProgrammer
ProProgrammer / RemovePeriodFromFileNames.py
Last active August 29, 2015 14:13
A quick dirty script to remove period (.) from file names in a folder
import os
# Change to directory where the files you want to work with are present
os.chdir('path/to/folder')
esclist = ["list","of","items","to", "escape", "renaming"]
for item in os.listdir(os.getcwd()):
if os.path.isfile(os.path.join(os.getcwd(),item)):
if '.' in item[:-4]:
@ProProgrammer
ProProgrammer / RemovePeriodFromFolderName.py
Created January 14, 2015 14:04
A quicky python script to remove period from folder names
import os
# Change to directory where the files you want to work with are present
os.chdir('path/to/folder')
for item in os.listdir(os.getcwd()):
if not os.path.isfile(os.path.join(os.getcwd(),item)):
if '.' in item:
os.rename(item, item.replace('.', ' '))
print item
@ProProgrammer
ProProgrammer / README.md
Last active August 29, 2015 14:18
See the gist via bl.ocks.org (want to see the map created using Folium)

First folium working map, planning to view it via bl.ocks.org

@ProProgrammer
ProProgrammer / README.md
Last active November 12, 2022 19:08
India Air quality over states map - Created using Folium

A Leaflet.js map created with Folium and the default D3 threshold scale. See the Gist for the python code to generate the dataframe. The map was generated with the following Python code:

map = folium.Map(location=[21, 78], zoom_start=5)
map.geo_json(geo_path=state_geo, data=state_data,
         columns=['State', 'SO2_average'],
         key_on='feature.id',
         fill_color='YlOrRd', fill_opacity=0.7, line_opacity=0.2,
         legend_name='Air Quality')
map.create_map(path='air_quality.html')
@ProProgrammer
ProProgrammer / flatten.py
Created April 1, 2016 17:55
Flatten a list using Python with test cases against the flatten function
def flatten(input_list):
flattened_output = []
for item in input_list:
if isinstance(item, int):
flattened_output.append(item)
else:
flattened_output += flatten(item)
return flattened_output
@ProProgrammer
ProProgrammer / index.html
Last active June 13, 2023 20:05
Sample HTML File for a Docker tutorial
<!DOCTYPE html>
<html>
<head>
<title>Sample HTML File</title>
<style type="text/css">
body {
background-color: #37474f;
}
h1 b {
font-color: #000000;
@ProProgrammer
ProProgrammer / Dockerfile
Created August 25, 2018 06:31
Dockerfile used for Dockerfile tutorial on Youtube
# This Dockerfile is used for a youtube tutorial
# base image - nginx with tag "latest"
FROM nginx:latest
# Adding custom index.html hosted on Github Gist
ADD https://gist.githubusercontent.com/ProProgrammer/72a87394affb0a70f54af6e6353e3c45/raw/37fcecc6d43dba55effa9e1fa6f7183f349b9ba0/index.html /usr/share/nginx/html/
# Adding read permissions to custom index.html
RUN chmod +r /usr/share/nginx/html/index.html
@ProProgrammer
ProProgrammer / index.html
Created September 14, 2018 22:05
Practicing JavaScript Hoisting with https://www.youtube.com/watch?v=sw49K4pxHCU
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>JavaScript Hoisting</title>
</head>
<body>
<!-- First check -->
<!-- <script type="text/javascript">
@ProProgrammer
ProProgrammer / exercise-maps.go
Created September 26, 2018 23:42
A Tour of Go: Exercise: Maps Implement WordCount. It should return a map of the counts of each “word” in the string s. The wc.Test function runs a test suite against the provided function and prints success or failure. You might find strings.Fields helpful.
package main
import (
"fmt"
"golang.org/x/tour/wc"
"strings"
)
func WordCount(s string) map[string]int {
outputMap := make(map[string]int)
@ProProgrammer
ProProgrammer / main.go
Last active September 29, 2018 14:15
Practicing pointers in Go based on explanation by Shawn here: https://www.youtube.com/watch?v=hMSYabOnA3M
package main
import "fmt"
func main() {
x := 42
fmt.Println("Address of x inside main:", &x)
fmt.Println("Initial value of x inside main before any external functions are called:", x)
fmt.Println("---------------")