#Create bitbucket branch
##Create local branch
$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
master
* sync
(function() { | |
var s=document.createElement('script'); | |
s.setAttribute('src','https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js'); | |
if(typeof jQuery!='undefined') { | |
var msg='This page already using jQuery v' + jQuery.fn.jquery; | |
} else { | |
document.getElementsByTagName('head')[0].appendChild(s); | |
var msg='This page is now jQuerified' | |
} | |
// Scraping Made Easy with jQuery and SelectorGadget | |
// (http://blog.dtrejo.com/scraping-made-easy-with-jquery-and-selectorga) | |
// by David Trejo | |
// | |
// Install node.js and npm: | |
// http://joyeur.com/2010/12/10/installing-node-and-npm/ | |
// Then run | |
// npm install jsdom jquery http-agent | |
// node numresults.js | |
// |
#!/usr/bin/env python | |
"""Command line script to convert a file, usually an image, into a data URI | |
for use on the web.""" | |
import base64 | |
import mimetypes | |
import os | |
import sys | |
#Create bitbucket branch
##Create local branch
$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
master
* sync
<cartridge_basiclti_link xmlns="http://www.imsglobal.org/xsd/imslticc_v1p0" | |
xmlns:blti="http://www.imsglobal.org/xsd/imsbasiclti_v1p0" | |
xmlns:lticm="http://www.imsglobal.org/xsd/imslticm_v1p0" | |
xmlns:lticp="http://www.imsglobal.org/xsd/imslticp_v1p0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://www.imsglobal.org/xsd/imslticc_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticc_v1p0.xsd http://www.imsglobal.org/xsd/imsbasiclti_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imsbasiclti_v1p0.xsd http://www.imsglobal.org/xsd/imslticm_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticm_v1p0.xsd http://www.imsglobal.org/xsd/imslticp_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticp_v1p0.xsd"> | |
<blti:title>External non-BLTI URL</blti:title> | |
<blti:description>This tool adds a Course Navigation item to a URL specified in the URL tag, after configuration it can be found under the navigation settings</blti:description> | |
<blti:launch_url>https://lti-examples.heroku.com/tool_r |
{%for u in users%} | |
{{u}} - {{u.last_login}}<br /> | |
{% endfor %} |
import requests | |
from io import open as iopen | |
from urlparse import urlsplit | |
def requests_image(file_url): | |
suffix_list = ['jpg', 'gif', 'png', 'tif', 'svg',] | |
file_name = urlsplit(file_url)[2].split('/')[-1] | |
file_suffix = file_name.split('.')[1] | |
i = requests.get(file_url) | |
if file_suffix in suffix_list and i.status_code == requests.codes.ok: |
Upgrade Django from 1.1 to 1.5.1. This highlights some of the issues that one may encounter when updating Django. It's not possible to cover every case, but this should provide a good general starting point.
Django now supports multiple databases and changes are needed to how the database connections are defined.
from django.contrib.auth.models import User | |
from django.conf import settings | |
import ldap | |
from baseauth import BaseAuthenticationBackend | |
import logging | |
class LdapAuthenticationBackend(BaseAuthenticationBackend): | |
def authenticate(self, username=None, password=None): | |
for ldap_auth in settings.LDAP_AUTH: |
Press minus + shift + s
and return
to chop/fold long lines!