Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
# webapp2/AppEngine | |
# in get method: | |
context = { | |
'goback_url': self.request.referer, | |
'info': the_info, | |
'maybe': Yes | |
} | |
# render the confirm form |
/*jslint browser: true*/ | |
(function ($) { | |
'use strict'; | |
$(document).ready(function () { | |
if ($('#rawJson').length) { | |
var rj = $('#rawJson').text(); | |
$('#fmtJson').html(JSON.stringify(JSON.parse(rj), null, 4)); | |
} |
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
# Table mapping response codes to messages; entries have the | |
# form {code: (shortmessage, longmessage)}. | |
# this is within: BaseHTTPServer.BaseHTTPRequestHandler.responses | |
# thanks to https://docs.python.org/2/howto/urllib2.html | |
responses = { | |
100: ('Continue', 'Request received, please continue'), | |
101: ('Switching Protocols', | |
'Switching to new protocol; obey Upgrade header'), | |
200: ('OK', 'Request fulfilled, document follows'), |
'use strict'; | |
var http = require('http'); | |
// blockchain.info/latestblock | |
var options = { | |
host: 'blockchain.info', | |
path: '/latestblock' | |
}; | |
var callback = function(response) { |
If you have to remove lots of deleted files:
$git rm $(git ls-files --deleted)
!function( $ ) { | |
'use strict'; | |
$(document).ready(function() { | |
/* https://github.com/mouse0270/bootstrap-growl */ | |
/*jshint multistr: true */ | |
if ($('.alert').length) { | |
$('.alert').each( function() { |
window.onerror = function(message, url, line_num) { | |
// Standard error information | |
var error = '\n JS Error: ' + message + ' from ' + url + ':' + line_num; | |
error += '\n URL: ' + document.URL; | |
// User agent info, using https://github.com/caseyohara/user-agent | |
var user_agent = new UserAgent(); | |
error += '\n Browser: ' + user_agent.browser_name + ' ' + user_agent.browser_version + ' | OS: ' + user_agent.os + ' | Platform: ' + user_agent.platform; |