First folium working map, planning to view it via bl.ocks.org
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
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')
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Sample HTML File</title> | |
<style type="text/css"> | |
body { | |
background-color: #37474f; | |
} | |
h1 b { | |
font-color: #000000; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>JavaScript Hoisting</title> | |
</head> | |
<body> | |
<!-- First check --> | |
<!-- <script type="text/javascript"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"golang.org/x/tour/wc" | |
"strings" | |
) | |
func WordCount(s string) map[string]int { | |
outputMap := make(map[string]int) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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("---------------") |