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
# In the ./app dir execute: remote_api_shell.py -s arts-612.appspot.com | |
# Script to get all the events listed by when they were posted | |
from app.modules.events.internal.entities import EventEntity | |
q = EventEntity.query() | |
hist = {} | |
cursor = None | |
more = True | |
while(more): |
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
# Generate a csv of the prefs data | |
# In the ./app dir execute: remote_api_shell.py -s pref-service.appspot.com | |
import csv | |
from api.entities import PreferenceEntity | |
from rest_core.utils import get_resource_id_from_key | |
q = PreferenceEntity.query() | |
cursor = None |
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
if environ['REQUEST_METHOD'] == 'OPTIONS' and environ['REQUEST_URI'][0:12] == '/_ah/upload/': | |
logging.warning("Hacked OPTIONS request for /_ah/upload - see module.828") | |
wrapped_start_response('200 SUPER GREAT', | |
[ | |
('Access-Control-Allow-Origin', '*'), | |
('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE'), | |
('Access-Control-Allow-Credentials', 'true'), | |
('Content-Type', 'application/json'), | |
('Access-Control-Allow-Headers', '*'), | |
]) |
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
# In the ./app dir execute: remote_api_shell.py -s arts-612.appspot.com | |
# Script to get all the events listed by when they were posted | |
from app.modules.events.internal.entities import EventEntity | |
q = EventEntity.query() | |
hist = {} | |
cursor = None | |
more = True | |
while(more): |
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 React from 'react'; | |
import PropTypes from 'prop-types'; | |
import MuiGrid from 'material-ui/Grid'; | |
import { withStyles } from 'material-ui/styles'; | |
import classNames from 'classnames'; | |
const styles = (theme) => { | |
// console.log(theme.spacing.unit); | |
// theme.spacing.unit * 2 |
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 csv | |
import requests # installed (pip install requests) | |
import json | |
INPUT_FILE = './data/diving-rods-survey-data-2017-04-24.csv' | |
BATCH_SIZE = 100 | |
PREF_API_URL = 'http://localhost:9090/api/rest/v1.0/preferences' | |
def submit_pref_data(data): |
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
// Simple React Class for managing the loading state of an image asset | |
var ImgLoader = React.createClass({ | |
loadHandler: function () { | |
this.setState({img_loaded: true}); | |
}, | |
getInitialState: function () { | |
return { | |
loading_src: 'https://dummyimage.com/700x700/ccc/ffffff.png&text=loading...', | |
img_loaded: false | |
} |
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
""" | |
Initial draft of helper code to create an 700x700 instagrammable image coponsed of other cover images. | |
""" | |
from PIL import Image | |
from PIL import ImageFont | |
from PIL import ImageDraw | |
from math import ceil | |