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($) { | |
| window.FlashMessages = { | |
| init: function() { | |
| this.container = $("#flash-messages") | |
| .find("a.message-close") | |
| .fadeIn("slow") | |
| .live("click", function() { | |
| $(this).parent() | |
| .fadeOut("slow", function() { | |
| $(this).remove(); |
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
| (pyall)rolando@atlantis:~/src/jquery/src$ grep IE *.js | |
| ajax.js: rheaders = /^(.*?):\s*(.*?)\r?$/mg, // IE leaves an \r character at EOL | |
| ajax.js:// #8138, IE may throw an exception when accessing | |
| ajax.js: // since IE will modify it given document.location | |
| ajax.js: // to avoid any 'Permission Denied' errors in IE | |
| ajax.js: // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) | |
| attributes.js: // Fixes Bug #2551 -- select.val() broken in IE after form.reset() | |
| attributes.js: // We can't allow the type property to be changed (since it causes problems in IE) | |
| attributes.js: // convert the value to a string (all browsers do this but IE) see #1070 | |
| attributes.js: // Some attributes require a special call on IE |
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
| Test Pass 122 | |
| test_remove_filename (__main__.GridFSTest) ... FAIL | |
| ====================================================================== | |
| FAIL: test_remove_filename (__main__.GridFSTest) | |
| ---------------------------------------------------------------------- | |
| Traceback (most recent call last): | |
| File "test_put.py", line 18, in test_remove_filename | |
| self.assertEqual(f._id, id2) | |
| AssertionError: ObjectId('4cc20c88e779893aae0002d6') != ObjectId('4cc20c88e779893aae0002d8') |
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 oursql | |
| import sys | |
| from twisted.enterprise import adbapi | |
| from twisted.internet import defer, reactor | |
| from twisted.python import log | |
| log.startLogging(sys.stderr) | |
| # Use 'test' database with default credentials |
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
| """ | |
| http://revista.python.org.ar/1/html/revista.html#desafio-python | |
| entrada: 11 | |
| salida: 11 | |
| entrada: 8 | |
| salida 2^3 | |
| entrada: 24 |
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
| """FizzBuzz program""" | |
| __author__ = "Rolando Espinoza La fuente <[email protected]>" | |
| __version__ = "1.0" | |
| def fizzbuzz(n): | |
| """ | |
| Returns whether Fizz or Buzz or Fizzbuzz or number. | |
| """ | |
| if n % 15 == 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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # author: Rolando Espinoza La fuente | |
| from scrapy.conf import settings | |
| from scrapy.core import signals | |
| from scrapy.core.manager import scrapymanager | |
| from scrapy.item import Item, Field | |
| from scrapy.selector import HtmlXPathSelector | |
| from scrapy.spider import BaseSpider |
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
| /* | |
| Dropbox.com hiring questions | |
| http://www.dropbox.com/webengineer | |
| 1) | |
| */ | |
| function countdown(num) { | |
| for (var i=0; i <= num; i += 1) { | |
| setTimeout(function() { | |
| alert(num - i); | |
| }, i * 1000); |
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
| """ file mytest.py """ | |
| # you require to return a HttpResponse instance in your view | |
| from django.http import HttpResponse | |
| # handler* are required for the urlresolver | |
| from django.conf.urls.defaults import patterns, handler404, handler500 | |
| # minimal settings | |
| DEBUG = True | |
| # tell django to use this file to find urlpatterns. see below | |
| ROOT_URLCONF = "mytest" |
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
| """ | |
| Restarts the application if any file changed. | |
| Borrowed from Tornado and Django. | |
| Usage: | |
| import txautoreload | |
| txautoreload.start() | |
| """ | |
| import types | |
| import os |