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
@never_cache | |
def login(request): | |
num = request.session.setdefault( 'Authentication-Attempts', 1 ); # in default added request.session[ 'Authentication-Attempts' ] = 1; | |
request.session[ 'Authentication-Attempts' ] += 1; | |
def http_unauthorized(): | |
response = HttpResponse( status = 401 ); | |
response[ "WWW-Authenticate" ] = "NTLM"; |
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
$( function() { | |
$( 'iframe' ).bind( 'load', function inject() { | |
var doc = $( 'iframe' ).contents()[0]; | |
doc.body.appendChild( $('<ol id="qunit-tests">' )[0] ); | |
function loadScript(path, callback) { | |
var scr = $( '<script>' ).attr( 'src', path ); |
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
class Range | |
def by(step) | |
each {|x| yield x} | |
end | |
end | |
Range.instance_methods.each {|x| puts x if x =~ /l/ } | |
(1...5).by(10) {|x| p x } |
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
colorscheme koehler | |
set backspace=3 | |
set autoread | |
set ignorecase | |
set nocompatible | |
set showfulltag | |
set showmode | |
set expandtab |
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
map fw :w<CR> | |
map fr :!ruby %<CR> | |
map fu :nohlsearch<CR> | |
map fn :bn<CR> | |
map fp :bp<CR> | |
colorscheme koehler | |
set nocompatible |
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
#there are at least two options I use both - not sure why :) | |
#option 1 | |
from django.db import connection | |
cursor = connection.cursor() | |
cursor.execute( "PRAGMA temp_store = MEMORY" ) | |
cursor.execute( "PRAGMA synchronous=OFF" ) |
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 sys, os | |
sys.path.append( os.path.dirname(__file__) + '/../..' ) | |
from django.conf import settings | |
settings.configure() | |
dir = os.path.dirname(__file__) + '/../database/' | |
test_db = dir + 'test_model.db' | |
test_db_journal = dir + 'test_model.db-journal' |
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
getActualReleaseBurndownData = function() { | |
var e, n, i, r, a = this.project().stories().get(this.get("release")), | |
s = this.project().stories().scope().inRelease(a), | |
o = s.points(), | |
l = this.project().get("time_zone"), | |
c = [], u = {}; | |
for (e = a.releaseStartDate(), n = new t.DateTime(e).atMidnight().getTime(), i = a.get("accepted_at") || | |
(new t.DateTime).getTime(), s = s.value(), c.push({y: o,x: n}); i >= n; ) { |
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
package main | |
import "fmt" | |
func main() { | |
var z interface{} | |
var z1 *int64 | |
z = z1 |
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
package main | |
import "fmt" | |
func main() { | |
z := [12]int64{} | |
fmt.Println(z) | |
z1 := z[4:10] |
OlderNewer