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 | |
""" | |
This simple script makes it easy to create server certificates | |
that are signed by your own Certificate Authority. | |
Mostly, this script just automates the workflow explained | |
in http://www.tc.umn.edu/~brams006/selfsign.html. | |
Before using this script, you'll need to create a private |
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(jQuery) { | |
var $ = jQuery; | |
function test(name, selectors, css) { | |
console.log("CSS test: " + name); | |
selectors.forEach(function(selector) { | |
var passed = 0; | |
var elements = $(selector); | |
if (!elements.length) | |
return console.error(" FAIL - nothing matches " + selector); |
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
$ ./test/smoke_test.py | |
15Running smoke test on localhost. | |
16 | |
17Setting up sample 'tinysmoke' repository. | |
18 |
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
from django.db import models | |
from django.contrib.auth.models import User | |
class Behavior(models.Model): | |
""" | |
Represents a type of user behavior, such as logging in, publishing, or | |
creating an HTML tag. | |
""" | |
short_name = models.CharField(max_length=50, unique=True) |
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
# Initialize the virtual environment. | |
$ source .virtualenv/bin/activate | |
# Install heroku-specific dependencies. | |
$ pip install -r requirements.txt | |
# Heroku requires pushing master, so make a branch. | |
$ git checkout -b master development | |
$ heroku create | |
$ heroku addons:add cleardb:ignite | |
$ git push heroku master | |
$ heroku run python manage.py syncdb |
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
const PORT = process.env['PORT'] || 3000; | |
const PROJECT = process.env['TRANSIFEX_PROJECT'] || 'friendlycode'; | |
const USERPASS = process.env['TRANSIFEX_USERPASS'] || ''; | |
const ROOT_LOCALE = process.env['TRANSIFEX_ROOT_LOCALE'] || 'en'; | |
const AUTH_HEADER = 'Basic ' + new Buffer(USERPASS).toString('base64'); | |
const BASE_TRANSIFEX_URL = 'https://www.transifex.com/api/2/project/' + | |
PROJECT; | |
const REVIEWED_RE = /^\/reviewed\/(.*)$/; | |
const TOPLEVEL_RE = /^\/(.*)\/nls\/([A-Za-z0-9\-_]+)\.js$/; | |
const LOCALE_RE = /^\/(.*)\/nls\/([a-z\-]+)\/([A-Za-z0-9\-_]+)\.js$/; |
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<title>Jessica B. Ipsum</title> | |
<style> | |
#myinput { | |
background: pink; | |
} | |
</style> | |
<h1>Vocabulary</h1> | |
<ul id="vocabulary"> |
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 upgrayedd = require('../index'); | |
var test = require('tap').test; | |
test('error thrown on setVersion() failure', function(t) { | |
upgrayedd.migrate({ | |
toVersion: 4, | |
storage: { | |
getVersion: function(cb) { cb(null, 1); }, | |
setVersion: function(v, cb) { cb("SETVERSION FAIL"); } | |
}, |
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 upgrayedd = require('../index'); | |
var test = require('tap').test; | |
test('error thrown on setVersion() failure', function(t) { | |
upgrayedd.migrate({ | |
toVersion: 4, | |
storage: { | |
getVersion: function(cb) { cb(null, 1); }, | |
setVersion: function(v, cb) { cb("SETVERSION FAIL"); } | |
}, |
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
""" | |
This small module makes it easy to bake PNG images with links to | |
Open Badge assertions. It also allows for easy retrieval of the link | |
from baked PNGs. | |
For more information on badge baking, see: | |
https://github.com/mozilla/openbadges/wiki/Badge-Baking | |
Note that this module requires the PyPNG module: |