This file contains 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
fields = ['user_name'] | |
cur.execute("SELECT {0} FROM users LIMIT 10".format( ','.join(fields) )) | |
for r in cur: | |
pairs = zip(fields, r) | |
self.write(r[0] + '<br />') |
This file contains 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
util = require "util" | |
xmpp = require "node-xmpp" | |
oscar = require 'oscar' | |
express = require "express" | |
### | |
The XMPP bot. | |
### |
This file contains 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
util = require "util" | |
xmpp = require "node-xmpp" | |
oscar = require 'oscar' | |
express = require "express" | |
### | |
The XMPP bot. | |
### |
This file contains 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
initRules: () -> | |
# Rules are children of reads. Setup the @rules collection, set a URL on the collection. | |
# then fetch all the children from the api | |
@rules = new Rules({}) | |
@rules.urlRoot = "#{@url()}/rules" |
This file contains 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
<?php | |
/** | |
* Validate Email Addresses Via SMTP | |
* This queries the SMTP server to see if the email address is accepted. | |
* @copyright http://creativecommons.org/licenses/by/2.0/ - Please keep this comment intact | |
* @author [email protected] | |
* @contributers [email protected] | |
* @version 0.1a | |
*/ |
This file contains 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
// An invalid domain. | |
// http://emailpie.com/v1/[email protected] | |
{ | |
"didyoumean": null, | |
"errors": [ | |
{ | |
"message": "No MX records found for the domain.", | |
"severity": 7 | |
} |
This file contains 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
➜ ~ ab -c 50 -n 1000 http://emailpie.com/ | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking emailpie.com (be patient) | |
Completed 100 requests | |
Completed 200 requests | |
Completed 300 requests | |
Completed 400 requests |
This file contains 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
# bad way | |
def new_message(request): | |
user = get_user_or_404(request) | |
message = request.POST.get('message', None) | |
if not message: | |
raise Http404 | |
user.save_new_message(message) |
This file contains 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
first = 1, 2, 3 | |
second = 1, null, null | |
result = _.all _.zip(first, second), (li) -> | |
if not li[1]? | |
return true | |
else if li[0] == li[1] | |
return true | |
else | |
return false |
This file contains 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/python | |
""" | |
first, install requests and oauth hook: | |
> sudo pip install requests requests-oauth -U | |
then run: | |
> python qbrequests.py |
OlderNewer