Skip to content

Instantly share code, notes, and snippets.

@efischer19
efischer19 / gist:b59802e853241c48cc2816cfff49f5d1
Last active August 7, 2017 15:05
Install dev branch of proctoring in sandbox
sudo vim /edx/app/edxapp/edx-platform/requirements/edx/github.txt
# comment out the edx-proctoring line, so it doesn't get re-installed on top of you
sudo su edxapp -s /bin/bash
cd
cd edx-platform
source ../edxapp_env
pip uninstall edx-proctoring -y
pip install git+https://github.com/edx/edx-proctoring.git@your_branch_name#egg=edx-proctoring==0.18.2
exit
#!/usr/bin/python
# -*- coding: utf-8 -*-
[
{u'time': u'0.004',
u'sql': u'SELECT `submissions_submission`.`id`, `submissions_submission`.`uuid`, `submissions_submission`.`student_item_id`, `submissions_submission`.`attempt_number`, `submissions_submission`.`submitted_at`, `submissions_submission`.`created_at`, `submissions_submission`.`raw_answer`, `submissions_submission`.`status` FROM `submissions_submission` WHERE (`submissions_submission`.`id` <= 7 AND `submissions_submission`.`id` >= 0) ORDER BY `submissions_submission`.`submitted_at` DESC, `submissions_submission`.`id` DESC'
},
{u'time': u'0.000',
u'sql': u"UPDATE `submissions_submission` SET `uuid` = '3fca942d09da41da92c1879851b1c512' WHERE `submissions_submission`.`id` = 7"
},
{u'time': u'0.000',
@efischer19
efischer19 / ffl_schedule.py
Last active September 4, 2017 18:22
Generating fantasy football schedules for the year
"""Output after running:
eric@oudebier:~/Desktop$ python ffl_schedule.py
Rando pairings: [('Zim', 'Td'), ('Kenny', 'Fish'), ('Jason', 'Steve'), ('Kyle', 'Brett'), ('Zane', 'Collin')]
In-division week 1: [('Td', 'Zim'), ('Jason', 'Zane'), ('Kenny', 'Kyle'), ('Brett', 'Collin'), ('Fish', 'Steve')]
In-division week 2: [('Fish', 'Kenny'), ('Kyle', 'Zane'), ('Jason', 'Zim'), ('Collin', 'Td'), ('Brett', 'Steve')]
In-division week 3: [('Jason', 'Steve'), ('Kyle', 'Zim'), ('Kenny', 'Zane'), ('Collin', 'Fish'), ('Brett', 'Td')]
In-division week 4: [('Brett', 'Kyle'), ('Jason', 'Kenny'), ('Zane', 'Zim'), ('Fish', 'Td'), ('Collin', 'Steve')]
In-division week 5: [('Collin', 'Zane'), ('Kenny', 'Zim'), ('Jason', 'Kyle'), ('Steve', 'Td'), ('Brett', 'Fish')]
Out-of-division week 1: [('Kenny', 'Td'), ('Jason', 'Fish'), ('Kyle', 'Steve'), ('Zane', 'Brett'), ('Zim', 'Collin')]
Out-of-division week 2: [('Jason', 'Td'), ('Kyle', 'Fish'), ('Zane', 'Steve'), ('Zim', 'Brett'), ('Kenny', 'Collin')]
@efischer19
efischer19 / all_the_things.sh
Last active September 22, 2017 13:54
Developing the assets page with studio-frontend
#!/bin/bash
# the "big hammer", kills any docker instances dead
sh ~/scripts/docker_destroy_all.sh
# delete *everything* I've been working on - it's all checked in right?
rm -rf ~/work/*
cd ~/work
sh ~/scripts/studio_frontend_development_env.sh
- clone edx/edx-proctoring into the ../src/ directory (relative to devstack)
- do the following twice, once in lms-shell and once in studio-shell:
- modify lms.env.json, the value for ENABLE_SPECIAL_EXAMS needs to be true (does not persist, will revert once you stop your container)
- modify cms.env.json, the value for ENABLE_SPECIAL_EXAMS needs to be true (does not persist, will revert once you stop your container)
- pip install -e /edx/src/edx-proctoring/ (might persist across container restarts, not sure, Leaning no)
- quit the shell, then `make (lms|studio)-restart` to restart the main django process.
- now, navigate to http://localhost:18010/settings/advanced/course-v1:edX+DemoX+Demo_Course in your browser (obvi, use a different course if needed)
- set "Enable Proctored Exams" and "Enable Timed Exams" to true there
- now we need to do stuff on an admin menu.
- do this if you've never created an admin user
@efischer19
efischer19 / r.js failure
Created January 10, 2018 16:28
devstack log
DOCKER_COMPOSE_FILES="-f docker-compose.yml -f docker-compose-host.yml" ./provision.sh
+ RED='\033[0;31m'
+ GREEN='\033[0;32m'
+ YELLOW='\033[0;33m'
+ NC='\033[0m'
+ docker-compose up -d mysql mongo
Creating volume "devstack_edxapp_lms_assets" with default driver
Creating volume "devstack_mysql_data" with default driver
Creating volume "devstack_edxapp_studio_assets" with default driver
Creating volume "devstack_discovery_assets" with default driver
ericfischer@dhcp-18-189-94-159:~/scripts$ cat docker_destroy_all.sh
#!/bin/bash
# Stop all containers
docker stop $(docker ps -a -q)
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
# Delete all volumes
docker volume rm -f $(docker volume ls -q)
@efischer19
efischer19 / On Clean Commits.md
Last active July 16, 2025 19:29
Commit Hygiene; a treatise on the Whys and Hows

Introduction

Commits (or changesets/patches) are the effective results of a developer's coding efforts. They describe a delta, or difference in contents that all other developers using a given codebase should also apply to their copies of the codebase, keeping it moving forward towards a common goal.

It would seem apparent that there exist "better" and "worse" ways of creating, describing, and otherwise talking about these individual changes, but actually nailing down a consensus definition of "good" or "best" is often tricky. What follows here is one experienced developer's opinion of why it matters and what "good" means, along with some links to back that up.

Contents

  1. Terminology
  2. Branch Strategy
  3. Smaller, Patch-ier Changes