Skip to content

Instantly share code, notes, and snippets.

View jhenry's full-sized avatar

Justin Henry jhenry

View GitHub Profile
@jhenry
jhenry / simple-git-branching-model.md
Created September 29, 2023 21:57 — forked from jbenet/simple-git-branching-model.md
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@jhenry
jhenry / batch_sandboxes.py
Last active July 8, 2022 22:53
generate batch files for brightspace sandboxes and enrollments
import numpy as np
import pandas as pd
output_path = '/Users/jhenry/Desktop/batch-sb'
users = pd.read_csv("/Users/jhenry/Desktop/usermap-sandboxers.csv")
course_cols = ['course_code', 'course_name', 'semester_code', 'template_code', 'template_name', 'dept_code', 'path', 'active', 'link_to_ct']
courses = pd.DataFrame(columns=course_cols)
enroll_cols = ['action', 'username', 'org_def_id', 'role_name', 'org_unit_code']
enrollments = pd.DataFrame(columns=enroll_cols)
@jhenry
jhenry / add-new-item-sync.scpt
Created March 6, 2021 18:05
Folder Action Handler to upload an added file and copy URL
(*
droplet - upload and copy url
This Folder Action handler is triggered whenever items are added to the attached folder.
The script uploads the file to the specified destination, and puts the URL in the clipboard.
Adapted from Ken Mickels' gist:
https://gist.github.com/kenmickles/bf8ffbf7117f4b394ff01c8edac11ebd
@jhenry
jhenry / jwplayer-theater-mode.js
Created December 12, 2020 23:49
jwplayer theater mode button
/* Your theater-mode.svg file for the icon might look something like:
345,93 Bot
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80">
<rect x="5" y="20" width="70" height="35" fill-opacity="0.01" stroke-width="8" stroke="lightgrey" shape-rendering="crispEdges" />
</svg>
*/
const buttonId = 'theater-mode-button';
const iconPath = '/theater-mode.svg';
const tooltipText = 'Theater Mode';
@jhenry
jhenry / bbid.js
Created July 31, 2020 17:09
Bb Id - Bookmarklet to show Blackboard Ids
javascript:(function()%7Bif('jQuery'%20in%20window)%7Blet%20showUids%3D(jq)%3D%3E%7Bjq('tbody%23listContainer_databody%20%3E%20tr').each((i%2Ctr)%3D%3E%7B%20var%20val%20%3D%20jq('input%5Btype%3Dcheckbox%5D'%2C%20tr).prop('value')%3B%20jq('th'%2C%20tr).append('%3Cdiv%3E%3Ci%3E'%2Bval%2B'%3C%2Fi%3E%3C%2Fdiv%3E')%3B%20%7D)%7D%3Blet%20ws%3D%5B%5D%3Bws.push(window)%3Blet%20ifr%3DjQuery('iframe').prop('contentWindow')%3Bif(ifr)%7Bws.push(ifr)%3B%7Dws.forEach((w)%3D%3E%7BshowUids(w.jQuery)%3B%7D)%3B%7D%7D)()

Keybase proof

I hereby claim:

  • I am jhenry on github.
  • I am jhenry (https://keybase.io/jhenry) on keybase.
  • I have a public key ASBjQ3ZNbPgHr4FZDndcNAxGZPEp8kYSLIuyDW8oU9bfzgo

To claim this, I am signing this object:

@jhenry
jhenry / batch_file_generator.rb
Created January 23, 2013 23:25
Quick and dirty Bb batch file creator is quick and dirty.
#!/usr/bin/env ruby
id_prefix = "ETS_HELPLINE"
user_list = "jhenry,bbaggin,fbaggin".split(',')
course_title_suffix = "001: ETS Helpline Sandbox Space"
t = Time.now()
datestamp = t.strftime("%Y%m%d")
users = Hash.new
module CmsHelper
def embed_calendar_widget(area_slug)
calendar = Cms::Page.find_by_slug("#{area_slug}_calendar")
is_enabled = get_page_block(calendar.blocks, "is_enabled")
widget_body = get_page_block(calendar.blocks, "widget_body")
if is_enabled == 'true'
content_tag(:div, widget_body, :id => "calendar_widget")
class ArticleIndexTest < ActiveSupport::TestCase
def setup
# create a parent page, which will display our index list
page_index = Cms::Page.new(
:slug => "top_page",
:label => "Page Top")
page_index.save!
# create Children, so we have something to list
(3.times).each { |i|
@jhenry
jhenry / tmux_textaurant.sh
Created January 11, 2011 02:50 — forked from dpickett/tmux_textaurant.sh
./tmux_starter_pistol.sh projectname
export PROJECT_NAME=$1
export WORKING_DIR=~/working/active/$PROJECT_NAME
cd $WORKING_DIR;
tmux start-server
tmux new-session -d -s $PROJECT_NAME -n work
tmux new-window -t$PROJECT_NAME:1 -n server
tmux new-window -t$PROJECT_NAME:2 -n test