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
import time | |
import re | |
from django.test import TestCase | |
from django.test.client import Client | |
from django.contrib.auth.models import User | |
from oauth_provider.models import Resource, Consumer | |
from oauth_provider.models import Token |
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
In [4]: u.password | |
Out[4]: u'crypt$MNVY.9ajgdvDQ$MNVY.9ajgdvDQ' | |
In [5]: u.check_password('foo') | |
--------------------------------------------------------------------------- | |
ValueError Traceback (most recent call last) | |
.../lib/python2.7/site-packages/django_extensions/management/commands/shell_plus.pyc in <module>() | |
----> 1 u.check_password('foo') | |
.../src/passlib/passlib/ext/django/utils.pyc in check_password(user, raw_password) |
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
base_url = 'http://nymkit.com/generators/chatterbots/gort/' | |
module.exports = (robot) -> | |
robot.catchAll (msg) -> | |
if msg.message.text.match(/\bgort\b/i) or msg.message.text.match(/\n/) | |
# When addressed, I'll pull something out of my... sock | |
# drawer. Or, if it's a multi-line message, I'll add my | |
# two cents. | |
json_params = | |
name: 'gort' |
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
/*global Backbone:false, $:false, _:false, extend:false */ | |
// Copyright (c) 2012, David Eyk for Good News Publishers | |
// All rights reserved. | |
// Redistribution and use in source and binary forms, with or without | |
// modification, are permitted provided that the following conditions | |
// are met: | |
// Redistributions of source code must retain the above copyright | |
// notice, this list of conditions and the following disclaimer. |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.define :web do |web| | |
# All Vagrant configuration is done here. The most common configuration | |
# options are documented and commented below. For a complete reference, |
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
var Lock = Backbone.Model.extend({ | |
initialize: function () { | |
this._queue = []; | |
this.set('_locked', false); | |
this.on('change:_locked', this._on_change_lock, this); | |
}, | |
_on_change_lock: function (m, locked) { | |
if (!locked && this._queue.length) { | |
var d = this._queue.shift(); |
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
$ http --verbose --form GET http://www.esvapi.org/v2/rest/readingPlanInfo key==IP reading-plan==bcp | |
GET /v2/rest/readingPlanInfo?key=IP&reading-plan=bcp HTTP/1.1 | |
Accept: */* | |
Accept-Encoding: gzip, deflate, compress | |
Content-Length: 0 | |
Content-Type: application/x-www-form-urlencoded; charset=utf-8 | |
Host: www.esvapi.org | |
User-Agent: HTTPie/0.4.1 |
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
import timeit | |
sorted_setup = """ | |
a = range(1000000) | |
""" | |
unsorted_setup = """ | |
from random import shuffle | |
{} | |
shuffle(a) |
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
.vagrant |
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
.vagrant |