Skip to content

Instantly share code, notes, and snippets.

View justinabrahms's full-sized avatar

Justin Abrahms justinabrahms

View GitHub Profile

github pull request querying

I’m querying review statuses for team so they can get a sense of who is doing all of the PR approvals and how long things are taking.

URL: https://github-url-here/api/graphql Header: Authorization: Bearer

query {
  search(query: "org:ORGHERE is:pr created:>2021-01-01", type: ISSUE, last: 50) {
@justinabrahms
justinabrahms / invoke.sh
Created April 28, 2022 18:09
Information on how to generate a nodejs license scan using SBOMs
npm i --production
npx -p @cyclonedx/bom cyclonedx-node -o bom.json
python ../license-scan.py
@justinabrahms
justinabrahms / avendar-id-parser.py
Created June 25, 2020 10:37
item parser for avendar.net
import re
from hashlib import sha256
class Item(object):
def __init__(self, item):
self.item = item
def __str__(self):
return self.item['name']
"""
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
#!/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 ]
"""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.

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.

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
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 August 29, 2015 14:06
Choose a random, acceptable keg from John's Marketplace in Portland.
from pyquery import PyQuery
import requests
from random import choice
url = 'http://www.johnsmarketplace.com/Kegs/'
query = 'td table tr'
def main():