This file contains hidden or 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 | |
from redis import StrictRedis | |
def pub(): | |
player_code = sys.argv[1] | |
r = StrictRedis(host='localhost', port=6379, db=0) | |
p = r.pubsub() |
This file contains hidden or 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
<!-- Example of blocking the link --> | |
<a href="#">This link should be visible</a><br /> | |
<?php if (!IPAuth::is_whitelisted()): ?> | |
<a href="#">This link should be hidden</a><br /> | |
<?php endif ?> |
This file contains hidden or 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
<html> | |
<head> | |
<script src="https://dev.graphite.org/sites/graphite.org/libraries/csm/api-js/api.js?o85slp"></script> | |
<script> | |
var options = { | |
clientId: 'xxxxxxxxxxxxxxxxxxxxxx', | |
appId: 'xxxxxxxxxxxxxxxxxxxxxx', | |
host: 'http://localhost:3000' | |
}; |
This file contains hidden or 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 Node(object): | |
def __init__(self, value, dependencies): | |
self.value = value | |
self.dependencies = dependencies | |
def output_pattern(graph_root): | |
stack = [graph_root] | |
output = [] | |
while len(stack): |
This file contains hidden or 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 unittest | |
# Let's assume that this is mocking output from a microservice. The mock | |
# also maps each value to whether or not it is a pangram so that we can | |
# use it as a fixture for testing against. | |
MOCK_SOURCES = { | |
'The quick brown fox jumps.': False, | |
'Bright vixens jump; dozy fowl quack.': True, | |
'this is not a pangram': False, |
This file contains hidden or 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 | |
function get_users() { | |
// API object is globally set. | |
global $api; | |
// Request #1: returns request object with query defaults (limit: 15, page: 1, fields: <all>, sort: none). | |
$users = $api | |
->users() | |
->get(); |
This file contains hidden or 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
""" | |
JSON data importer to a MS SQL database. | |
NOTE: This code has not been tested and is for the sole purpose of showing example code | |
for a simple data import workflow using a non-optimized design without error handling. | |
""" | |
import json | |
import urllib | |
from os import getenv |
This file contains hidden or 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
Name Feature Status Version State | |
BEF Test Content bef_test_content Disabled 7.x-3.2 | |
CSM Education csm_education_feature Enabled 7.x-5.0 | |
CSM Field Bases csm_field_bases_feature Enabled 7.x-4.3 | |
CSM Learning Ratings csm_learning_ratings_feature Enabled 7.x-6.3 | |
CSM Migration Feature csm_migration_feature Enabled 7.x-3.8 | |
CSM Schools csm_schools_feature Enabled 7.x-5.3 | |
CSM Taxonomies Feature csm_taxonomies_feature Enabled 7.x-5.0 | |
Date Migration Example date_migrate_example Disabled 7.x-2.9 | |
Features Extra test feature features_extra_test Disabled |
This file contains hidden or 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
Name Feature Status Version State | |
BEF Test Content bef_test_content Disabled 7.x-3.2 | |
CSM Education csm_education_feature Enabled 7.x-5.0 | |
CSM Field Bases csm_field_bases_feature Enabled 7.x-4.3 | |
CSM Learning Ratings csm_learning_ratings_feature Enabled 7.x-6.3 | |
CSM Migration Feature csm_migration_feature Enabled 7.x-3.8 | |
CSM Schools csm_schools_feature Enabled 7.x-5.3 | |
CSM Taxonomies Feature csm_taxonomies_feature Enabled 7.x-5.0 | |
Date Migration Example date_migrate_example Disabled 7.x-2.9 | |
Features Extra test feature features_extra_test Disabled |
This file contains hidden or 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
# Save incoming data. | |
user = User(); | |
user.id = <id> | |
user.first_name = <firstName> | |
user.last_name = <lastName> | |
db.users.save(user) | |
# Output API data - get a list of users. | |
output = User.find({}, { limit: 15 }) |
NewerOlder