if(i-words < 0):
start_point = 0
else:
start_point = i - words
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
TypeError: Decimal('499.00') is not JSON serializable |
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 smtplib | |
>>> gmail_smtp='74.125.127.109' | |
>>> handle = smtplib.SMTP(gmail_smtp, 25) | |
>>> handle.ehlo() | |
(250, 'mx.google.com at your service, [58.246.22.38]\nSIZE 35882577\n8BITMIME\nS | |
TARTTLS\nENHANCEDSTATUSCODES') | |
>>> handle.starttls() | |
(220, '2.0.0 Ready to start TLS') | |
>>> handle.login('[email protected]', 'xxxxxxx') | |
(235, '2.7.0 Accepted') |
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
#Call this inside ~/.ipython/ipy_user_conf.py main() | |
import sys | |
import subprocess | |
from os import environ | |
if 'VIRTUAL_ENV' in environ: | |
#This is kludgy but it works; grab the right sys.path from the virtualenv python install: | |
path = subprocess.Popen(['python', '-c','import sys;print(repr(sys.path))'], | |
stdout=subprocess.PIPE).communicate()[0] |
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
~ cat /etc/hosts | |
## | |
# Host Database | |
# | |
# localhost is used to configure the loopback interface | |
# when the system is booting. Do not change this entry. | |
## | |
127.0.0.1 localhost | |
255.255.255.255 broadcasthost | |
::1 localhost |
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
~ cat /etc/hosts | |
## | |
# Host Database | |
# | |
# localhost is used to configure the loopback interface | |
# when the system is booting. Do not change this entry. | |
## | |
127.0.0.1 localhost | |
255.255.255.255 broadcasthost | |
::1 localhost |
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
//quick online/offline check | |
function hasInternets() { | |
var s = $.ajax({ | |
type: "HEAD", | |
url: window.location.href.split("?")[0] + "?" + Math.random(), | |
async: false | |
}).status; | |
//thx http://www.louisremi.com/2011/04/22/navigator-online-alternative-serverreachable/ | |
return s >= 200 && s < 300 || s === 304; | |
}; |
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
>>> document.cookie = 'visited=; expires=Thu, 01-Jan-70 00:00:01 GMT;'; | |
"visited=; expires=Thu, 01-Jan-70 00:00:01 GMT;" | |
>>> document.cookie | |
"_vis_opt_s=1%7C; _vis_opt_exp_16_exclude=1; C_SOURCEID=1iMdUrqQzWnr0hWYd6hfb1PHjDLHW7%26link%26200; __utmx=228830211.; __utmxx=228830211.; userid="qDVQs1QiohGOOarNtVwHYl,"; __utmz=127460183.1308566462.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmz=228830211.1309499889.69.35.utmcsr=192.168.0.117:5000|utmccn=(referral)|utmcmd=referral|utmcct=/shop/jassen; __utma=228830211.656686459.1304905179.1309230703.1309499889.69; 2s4uses=e434f7fc5fde45455f71fc683139c368577e6f5bgAJ9cQEoVQlzaG9wLnNpemVxAl1xA1ULc2hvcC5jb2xvdXJxBF1xBVUNc2hvcC5jYXRlZ29yeXEGWA0AAABqdXJrZW4tcm9ra2VucQdVA19pZHEIVSA0MzMwMTRkZmM3ODI0ZGViMTA0OTUyMzI3ZGVlMjJiOXEJVQ5fYWNjZXNzZWRfdGltZXEKR0HThPDan1JIVQ5fY3JlYXRpb25fdGltZXELR0HThPAv1KtcdS4=; NM_2STYLE4YOU=1d54e26f25e3c9797204b964f230b8550a2955fa49b6c97ff8f6e542d0c2918b; __utma=127460183.1554753308.1308566462.1309418988.1309917256.14; __utmc=127460183; vi |
-
The new rake task assets:clean removes precompiled assets. [fxn]
-
Application and plugin generation run bundle install unless
--skip-gemfile
or--skip-bundle
. [fxn] -
Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]
-
Template generation for jdbcpostgresql #jruby [Vishnu Atrai]