This file contains 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
g<-c("http://www.google.com","http://www.google.co.in") | |
q<-c("thalassemia") | |
paste0(g[1],"/?q=",q) | |
library(rvest) | |
pg<-html(paste0(g[1],"/?q=",q)) |
This file contains 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
#https://gist.github.com/dsparks/3710171 | |
#MELT DATA | |
display.brewer.all() | |
myPalette <- colorRampPalette(brewer.pal(7, "RdYlGn")) | |
zp1 <- ggplot(star3[CIN=="H2643"], | |
aes(x = variable, y = CIN, fill = value)) | |
zp1 <- zp1 + geom_tile() |
This file contains 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
server{ | |
listen 80; | |
server_name rr.saurabhgaur.com; | |
location / { | |
proxy_pass http://127.0.0.1:8787; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
} |
This file contains 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
circle <- function(x, y, r, ...) { | |
ang <- seq(0, 2*pi, length = 100) | |
xx <- x + r * cos(ang) | |
yy <- y + r * sin(ang) | |
polygon(xx, yy, ...) | |
} | |
venndia2 <- function(A, B, C, label,getdata=FALSE, ...){ | |
cMissing <- missing(C) | |
if(cMissing){ C <- c() } |
This file contains 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
circle <- function(x, y, r, ...) { | |
ang <- seq(0, 2*pi, length = 100) | |
xx <- x + r * cos(ang) | |
yy <- y + r * sin(ang) | |
polygon(xx, yy, ...) | |
} | |
venndia <- function(A, B, C, getdata=FALSE, ...){ | |
cMissing <- missing(C) | |
if(cMissing){ C <- c() } |
This file contains 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
from datetime import datetime | |
import time | |
#------------------------------------------------- | |
# conversions to strings | |
#------------------------------------------------- | |
# datetime object to string | |
dt_obj = datetime(2008, 11, 10, 17, 53, 59) | |
date_str = dt_obj.strftime("%Y-%m-%d %H:%M:%S") | |
print date_str |
This file contains 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
class Feeds(db.Model): | |
articleid = db.IntegerProperty() | |
feedlistid = db.IntegerProperty() | |
title = db.StringProperty() | |
itemurl = db.LinkProperty() | |
img = db.LinkProperty() | |
textmin = db.StringProperty() | |
textfull = db.TextProperty() | |
dated = db.DateTimeProperty() | |
isRead = db.BooleanProperty() |
This file contains 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
form_fields = json.dumps({ | |
"consumer_key": "10919-c09bc8099013395a6bf878ac", | |
"redirect_uri": "http://saurabh.com", | |
"email_address": "Albert.Johnson@example.com" | |
}) | |
url="https://getpocket.com/v3/oauth/request" | |
#form_data = urllib.urlencode(form_fields) | |
result = urlfetch.fetch(url=url, | |
payload=form_fields, | |
method=urlfetch.POST, |
This file contains 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 | |
import webapp2 | |
import jinja2 | |
import urllib2 | |
from google.appengine.ext import db | |
from xml.dom import minidom | |
from datetime import datetime,timedelta | |
from google.appengine.api import urlfetch | |
import json |
This file contains 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
application: srbhgaur02 | |
version: 1 | |
runtime: python27 | |
api_version: 1 | |
threadsafe: yes | |
handlers: | |
- url: /favicon\.ico | |
static_files: favicon.ico | |
upload: favicon\.ico |