Request URL:https://www.irctc.co.in/cgi-bin/bv60.dll/irctc/booking/planner.do?BV_SessionID=@@@@1460333113.1362805670@@@@&BV_EngineID=ccddadfjfkjiklecefecehidfgmdfjg.0
Request Method:POST
Status Code:200 OK
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
Here is a list of scopes to use in Sublime Text 2 snippets - | |
ActionScript: source.actionscript.2 | |
AppleScript: source.applescript | |
ASP: source.asp | |
Batch FIle: source.dosbatch | |
C#: source.cs | |
C++: source.c++ | |
Clojure: source.clojure | |
CoffeeScript: source.coffee |
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
from django.core.files import File | |
from django.core.files.temp import NamedTemporaryFile | |
img_temp = NamedTemporaryFile(delete=True) | |
img_temp.write(urllib2.urlopen(url).read()) | |
img_temp.flush() | |
im.file.save(img_filename, File(img_temp)) |
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
function isOnScreen(elem) { | |
var $window = $(window) | |
var viewport_top = $window.scrollTop() | |
var viewport_height = $window.height() | |
var viewport_bottom = viewport_top + viewport_height | |
var $elem = $(elem) | |
var top = $elem.offset().top | |
var height = $elem.height() | |
var bottom = top + height |
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 | |
from django.core.files import File | |
from django.core.files.temp import NamedTemporaryFile | |
def save_image_from_url(model, url): | |
r = requests.get(url) | |
img_temp = NamedTemporaryFile(delete=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
Bringing machine 'default' up with 'virtualbox' provider... | |
[default] Setting the name of the VM... | |
[default] Clearing any previously set forwarded ports... | |
[default] Creating shared folders metadata... | |
[default] Clearing any previously set network interfaces... | |
[default] Preparing network interfaces based on configuration... | |
[default] Forwarding ports... | |
[default] -- 22 => 2222 (adapter 1) | |
[default] -- 80 => 8080 (adapter 1) | |
[default] -- 8983 => 18983 (adapter 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
CREATE TABLE `user` ( | |
`twitter_id` int(10) unsigned NOT NULL, | |
`created_at` timestamp NOT NULL default '0000-00-00 00:00:00', | |
`name` varchar(80) NOT NULL, | |
`screen_name` varchar(30) NOT NULL, | |
`location` varchar(120) default NULL, | |
`description` varchar(640) default NULL, | |
`profile_image_url` varchar(400) NOT NULL, | |
`url` varchar(100) default NULL, |
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
/* Inject this CSS with any extension to your browser. | |
I use Personalized Web, Chrome extension */ | |
.wrapper, .wrapper-narrow, .wrapper-permalink { | |
width: 95% !important; | |
} | |
.content-main { | |
width: 74% !important; | |
} | |
.profile-card.profile-header { | |
width: 74% !important; |
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
from datetime import datetime | |
def get_timestamp_from_datetime(dt): | |
UNIX_EPOCH = datetime(1970, 1, 1, 0, 0, 0, 0) | |
delta = dt - UNIX_EPOCH | |
seconds = delta.total_seconds() | |
return seconds |
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
class SimpleMultiDict(dict): | |
def getlist(self, key): | |
return self[key] if type(self[key]) == list else [self[key]] | |
def __repr__(self): | |
return type(self).__name__+'('+dict.__repr__(self)+')' |