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
var geoCoordMap = { | |
'SUNNYVALE': [-122.0144, 37.386], | |
'BENGALURU': [77.580643, 12.972442], | |
'US': [-97.822, 37.751], | |
'SARATOGA': [-122.0230, 37.2638], | |
'CHENNAI':[80.2707, 13.0827], | |
'MUMBAI':[72.8777, 19.0760] | |
}; | |
var PopData = [ | |
[{name:'US'}, {name:'US',value:95}], |
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
docker run --rm -it --name dcv -v /home/user/blog:/input pmsipilot/docker-compose-viz render -m image --force docker-compose.yml --output-file=topology.png --no-volumes --no-ports --no-networks |
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
version: '3.4' | |
services: | |
rabbitmq: | |
image: rabbitmq:3-management | |
ports: | |
- "15672:15672" | |
- "5672:5672" | |
deploy: | |
replicas: 1 |
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 matplotlib.pyplot as plt | |
# The slices will be ordered and plotted counter-clockwise. | |
labels = 'Frogs', 'Hogs', 'Dogs', 'Logs' | |
sizes = [15, 30, 45, 10] | |
colors = ['yellowgreen', 'gold', 'lightskyblue', 'lightcoral'] | |
explode = (0, 0, 0, 0) # explode a slice if required | |
plt.pie(sizes, explode=explode, labels=labels, colors=colors, | |
autopct='%1.1f%%', shadow=True) |
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 requests | |
import BeautifulSoup | |
import string | |
session = requests.session() | |
alphas = list(string.ascii_uppercase) | |
for i in alphas: | |
url_parse = "http://www.medindia.net/drugs/manufacturers.asp?alpha=" + i | |
req = session.get(url_parse) | |
doc = BeautifulSoup.BeautifulSoup(req.content) | |
manufacturers_div = doc.find("div", attrs={"class": "headlines clear-fix"}) |
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
mysql --user=wibble --password wobble -B -e "select * from vehicle_categories;" | sed "s/'/\'/;s/\t/\",\"/g;s/^/\"/;s/$/\"/;s/\n//g" > vehicle_categories.csv |
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 requests | |
import BeautifulSoup | |
fo = open("ossmat.html", "wb") | |
session = requests.session() | |
for page in range(1,10): | |
req = session.get('http://ssmatri.net/setup/ProfileListview.asp?type=GI&sh=1&thisPage='+ str(page)) | |
doc = BeautifulSoup.BeautifulSoup(req.content) | |
all_td = doc.findAll('tr') | |
#for x in range(10,20): |
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
PS> $data = get-childitem . "folder*" -rec -force | select directory, name | |
PS> foreach($x in $data) { $url = $x.directory.tostring() + '\' + $x.name.tostring(); remove-item $url -force;} |
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
wget http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz | |
tar -xzvf ruby-2.0.0-p247.tar.gz | |
cd ruby-2.0.0-p247 | |
autoconf | |
./configure --program-suffix=19 --enable-shared --with-readline-dir=/usr/local | |
make | |
sudo make install | |
ruby -v | |
wget http://rubyforge.org/frs/download.php/76729/rubygems-1.8.25.tgz | |
tar -xzvf rubygems-1.8.25.tgz |
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
#!/usr/bin/env php | |
# This function prints the difference between two php datetime objects | |
# in a more human readable form | |
# inputs should be like strtotime($date) | |
# Adapted from https://gist.github.com/207624 python version | |
function humanizeDateDiffference($now,$otherDate=null,$offset=null){ | |
if($otherDate != null){ | |
$offset = $now - $otherDate; | |
} |