Skip to content

Instantly share code, notes, and snippets.

Avatar

Justin Abrahms justinabrahms

View GitHub Profile
@justinabrahms
justinabrahms / avendar-id-parser.py
Created Jun 25, 2020
item parser for avendar.net
View avendar-id-parser.py
import re
from hashlib import sha256
class Item(object):
def __init__(self, item):
self.item = item
def __str__(self):
return self.item['name']
View edx.py
"""
Fetches some valid oauth credentials from edX, using only the secret & app key.
Based primarly off of the Facebook example in flask-oauth
"""
from flask import Flask, redirect, url_for, session, request
from flask_oauth import OAuth
View tmux-att.sh
#!/bin/sh
# Originally from https://gist.github.com/dmkash/2355219
SESSION_NAME="ccxcon"
cd ~/src/github.com/mitodl/ccxcon
tmux has-session -t ${SESSION_NAME}
if [ $? != 0 ]
View main.py
"""Goal here is to obfuscate GPG blocks using markov chains.
Steps:
1. Train markov chain with some news articles on a similar topic.
2. Take in a GPG armored ascii block.
3. Use that input to determine which branch of the markov chain to walk.
4. The result would be a new article similar to the inputs.
5. The user could then take the same program, run it against the same
inputs, and output the GPG block.
View mit_edx_onboarding_errors.md

mongod won't start.

If you've tried sudo service mongod start and it says it started but didn't, or maybe gives you a cryptic error.. consider removing the lock file at /edx/var/mongo/mongodb/mongod.lock and try again.

No locks available.

So, when running some tests, I got the error "No locks available". This post suggests NFS. The actual fix appears to be to restart rpcbind sudo service rpcbind restart which hung my vagrant VM. When it restarted, I got the error below, but things seemed to work as I wanted and I'm slowly backing away.

View code_review.md

Code Review

A guide for reviewing code and having your code reviewed.

Peer code reviews are the single biggest thing you can do to improve your code - Jeff Atwood

Purpose

Code review is an important part of a team's development process. It helps to:

  • disseminate knowledge about the codebase/technology/techniques across teams
  • increase awareness of the features being developed
View gist:40c256ce2548da2d6e79
def do_sprintly_automated_deploy(role, current_build, build_number):
"""
Find what tickets were in this deploy and mark them as deployed in Sprintly.
"""
if not settings.GITHUB_PERSONAL_TOKEN or not settings.SPRINTLY_API_KEY \
or not settings.SPRINTLY_EMAIL:
print 'Missing required settings for automated deploy.'
return
@justinabrahms
justinabrahms / gist:bdcbc7a2da010d7aff6e
Last active Aug 29, 2015
Choose a random, acceptable keg from John's Marketplace in Portland.
View gist:bdcbc7a2da010d7aff6e
from pyquery import PyQuery
import requests
from random import choice
url = 'http://www.johnsmarketplace.com/Kegs/'
query = 'td table tr'
def main():
View git-stash-grep
#!/bin/bash
for i in `git stash list --format="%gd"`; do
git stash show -p $i | grep -H --label="$i" "$1"
done
@justinabrahms
justinabrahms / .pdbrc.py
Created Jul 23, 2014
default pdbpp to start with sticky enabled
View .pdbrc.py
import pdb
class Config(pdb.DefaultConfig):
sticky_by_default = True