Skip to content

Instantly share code, notes, and snippets.

View sauravtom's full-sized avatar
🏠
Working from home

Saurav Kumar sauravtom

🏠
Working from home
View GitHub Profile
@sauravtom
sauravtom / wtf.txt
Created January 27, 2013 17:49
YQL Search string
YQL search string,
encodeURIComponent
http://query.yahooapis.com/v1/public/streaming/yql?q=
select%20*%20from%20html%20where%20url%3D%22https%3A%2F%2Ftwitter.com%2Fsearch%2Frealtime%3Fq%3Dvine.co%252Fv%252F%2B%252B%2Bmom%26src%3Dtypd%22
@sauravtom
sauravtom / workflow.txt
Last active December 12, 2015 03:28
Making a web scraper in python
#-------------------------------------------------------
import urllib2
import json as simplejson
response = urllib2.urlopen('https://twitter.com/')
html=response.read()
print html
@sauravtom
sauravtom / set_int_fib.html
Created February 13, 2013 04:04
Example of set time interval : Continously print fibonacci numbers on the screen
<!doctype html>
<html lang="en">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<title>Sauraxe</title>
<style type="text/css">
#x{
//text-align:center;
font-size:10px;
font-family:‘American Typewriter’, ‘Courier New’, Courier, Monaco, mono;
@sauravtom
sauravtom / bkmt.js
Created March 2, 2013 03:15
Bookmarktlet that is supposed to download vimeo video, but doesn't work.and i know why.
javascript: (function () {
var vim_id = document.URL.substring(17);
var url = 'http://player.vimeo.com/play_redirect?quality=hd&codecs=h264&clip_id='
+vim_id+
'&time=1362143485&sig=e846af3c50137c059ea2099a220a1f8b&type=html5_desktop_local';
saveToDisk(url, document.URL+'.mp4');
console.log(url);
function saveToDisk(fileUrl, fileName) {
var save = document.createElement("a");
@sauravtom
sauravtom / foo.py
Last active December 14, 2015 12:59
My solution python challenge 1 http://www.pythonchallenge.com/pc/def/map.html
text ='''g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj.'''
def trans(string):
poop=''
for i in string:
#if i in ['.' , ',' , ')' , '(' , "'"," "]: #dont translate special characters
if in in " .,'():;":
poop+=i
else:
@sauravtom
sauravtom / shurl.py
Created March 14, 2013 14:31
Goo.gl url shortening wrapper for python
#!/usr/bin/python
from sys import argv
import httplib2
import simplejson as json
#API_KEY = ADD YOUR API KEY HERE , even if you don't shurl will still work
def shurl(longUrl):
@sauravtom
sauravtom / mangafox_bkmrlt.js
Created March 23, 2013 16:11
Simple bookmarklet to make reading mangas of mangafox less painful.V1
javascript: (function () {
var all = document.getElementsByTagName("div");
var viewer = document.getElementById("viewer").style;
for (var i=0, max=all.length; i < max; i++) {
all[i].style.visibility='hidden';
}
viewer.visibility='visible';
viewer.position='absolute';
@sauravtom
sauravtom / mangafox.js
Last active December 15, 2015 08:08
A better way to read mangafox.
script = document.createElement( 'script' );
script.src = 'http://code.jquery.com/jquery-1.9.1.js';
document.body.appendChild(script);
var all = document.getElementsByTagName("div");
var viewer = document.getElementById("viewer").style;
for (var i=0, max=all.length; i < max; i++) {
all[i].style.visibility='hidden';
@sauravtom
sauravtom / foo.css
Last active December 16, 2015 05:59
iframe{
position:absolute;
top:0px;
bottom:0px;
}
@sauravtom
sauravtom / lace1_solutions.txt
Created October 4, 2013 01:49
Solutions to lace1
Question 1
Fibonacci series are defined as the number in the following integer sequence 0,1,1,2,3,5,8,13,21,34,55,89,144 <br>
Let there be a function such that f(0,1) which generates the fibonacci series, where 0,1 are the first two terms of the fibonacci series.
such that f(4,5) will generate the following series 4,5,9,14,23,37,60 ... <br>
Find the 20th term of the series represented f(100,101)
ANS 1101365
Solution: