Skip to content

Instantly share code, notes, and snippets.

View astronomersiva's full-sized avatar

Sivasubramanyam A astronomersiva

View GitHub Profile
@astronomersiva
astronomersiva / swift
Last active August 29, 2015 14:17
Learning Swift
//Uses LLVM compiler just like Objective C.
//optional: variables that may not be used. contains null.
import UIKit
//variables
var str = "Hello, playground"
var myInteger = 90; //semicolon is optional
var boolExample = true //or false
import requests
import json
from random import randint
#Needs the requests module.
#Use (sudo) pip install requests
#http://www.timestampgenerator.com/
#Use this link to generate the timeStamp.
timeStamp = InsertUTCTimeStampHere(eg.1415994915)
import sqlite3
import os
import sys
import numpy as np
from urlparse import urlparse
from matplotlib import pyplot as plt
for path in (
os.path.expanduser('~/.config/google-chrome/'),
<!DOCTYPE html>
<html>
<head>
<title>Weather at your place</title>
<meta name="description" content="Weather">
<meta name="keywords" content="Weather,JavaScript">
<meta name="author" content="Sivasubramanyam">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="js/script.js"></script>
<link rel="stylesheet" type="text/css" href="css/weather-icons.css">
function geoFindMe(){
if(navigator.geolocation){
navigator.geolocation.getCurrentPosition(success, error, geo_options);
}else{
alert("Geolocation services are not supported by your web browser.");
}
function success(position) {
import android
import time
import urllib2
import json
import re
import random
droid = android.Android()
def speedDet():
from flask import render_template
from app import app
import requests
from bs4 import BeautifulSoup
url = "http://static.cricinfo.com/rss/livescores.xml"
teams = (
"Chennai", "Delhi",
"Punjab", "Kolkata",
"Mumbai", "Rajasthan",
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta content="sivasubramanyam,sivasubramanyam.me" name="keywords">
<meta content="Sivasubramanyam A" name="author">
<meta content="width=device-width, initial-scale=1" name="viewport">
<title>Sivasubramanyam A</title>
from facepy import GraphAPI
import mechanize
from time import strftime
from bs4 import *
from datetime import datetime, date, timedelta
from time import strptime
from getopt import getopt
import os, sys, envoy
import urllib2,json
import urllib2
import json
import webbrowser
from datetime import datetime
startTime=datetime.now()
#Will be used to launch a web browser and view the output
filepath = 'file:///Earthquakebigg.html'
#Read complete documentation for the API here-http://www.openhazards.com/data/GetEarthquakeCatalog