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
names_to_test = [ | |
'blah', | |
'foo', | |
'bar', | |
] | |
for name in names_to_test: | |
stripped_name = util.clean_string(name) | |
pattern = r'^[A-Za-z]+$' | |
re.match(pattern, stripped_name) |
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 QualtricsLink(NamedModel): | |
def get_link(self): | |
keys = QualtricsLink.all().fetch(100, keys_only=True) | |
try: | |
link = self._get_link_transactionally(keys.pop()) | |
# repeat if you don't have a link | |
return link.link_string | |
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
/* | |
MIT License | |
Copyright (c) 2018 PERTS | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
<?php | |
// Institutional Survey Redirector Sample | |
// -------------------------------------- | |
// | |
// The purpose of this script is to demonstrate how institutions should | |
// handle a student and correctly send them to CTC's systems. | |
// | |
// Please be familiar with the documentation. | |
// |
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
// See http://ejohn.org/blog/partial-functions-in-javascript/ | |
Function.prototype.partial = function () { | |
'use strict'; | |
var fn = this, args = Array.prototype.slice.call(arguments), i; | |
return function () { | |
var arg = 0; | |
for (i = 0; i < args.length && arg < arguments.length; i += 1) { | |
if (args[i] === undefined) { | |
args[i] = arguments[arg]; | |
arg += 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
from google.appengine.api import datastore # for reading backup files | |
from google.appengine.api.files import records # for reading backup files | |
from google.appengine.datastore import entity_pb # for reading backup files | |
from mapreduce import base_handler | |
from mapreduce import mapreduce_pipeline | |
from mapreduce import operation as op | |
from mapreduce import shuffler | |
import json | |
import logging |
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 allUsers = []; | |
// var allActivities = []; | |
var activitiesByClassroom = {}; | |
forEach(allActivities, function (act) { | |
if (act.activity_ordinal === "1") { | |
activitiesByClassroom[act.assc_classroom_list[0]] = act; | |
} | |
}); |
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
{ | |
// -------------------------------------------------------------------- | |
// JSHint Configuration, Strict Edition, for PERTS | |
// -------------------------------------------------------------------- | |
// | |
// This is a options template for [JSHint][1], using [JSHint example][2] | |
// and [Ory Band's example][3] as basis and setting config values to | |
// be most strict: | |
// | |
// * set all enforcing options to 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
import random | |
foods = [ | |
'onion', | |
'carrot', | |
'pear', | |
'bean', | |
'corn', | |
'bread', | |
'apple', |
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
// Read query string parameters as a javascript object. | |
// | |
// Not tested for: | |
// | |
// * Mixing bracketed and non-bracketed keys | |
// * Indexed brackets | |
// * Nested lists | |
// | |
// Some examples (See unit tests below for full details): | |
// |
OlderNewer