Skip to content

Instantly share code, notes, and snippets.

View sheepeeh's full-sized avatar

Rachel Donahue sheepeeh

View GitHub Profile
@sheepeeh
sheepeeh / wpd2docx.vb
Last active July 21, 2016 19:11
Convert WPD to DOCX using a Word macro
Function browseForFolder()
Dim intResult As Integer
Dim strPath As String
'the dialog is displayed to the user
intResult = Application.FileDialog(msoFileDialogFolderPicker).Show
'checks if user has cancled the dialog
If intResult <> 0 Then
'dispaly message box
browseForFolder = Application.FileDialog(msoFileDialogFolderPicker).SelectedItems(1)
End If
@sheepeeh
sheepeeh / fancybox-keyboard-focus.js
Last active November 18, 2016 22:34
Make fancybox more friendly to keyboard users. Title information is specific to Omeka, but the rest should work anywhere.
// Omeka loads jQuery No Conflict by default, so we can't use $
jQuery(document).ready(function() {
/* Code to make fancybox more accessible
Be sure to also set .fancybox-nav span's visibility to "visible"
so buttons are shown without the mouse. */
jQuery('.fancybox').fancybox({
openEffect : 'none',
closeEffect : 'none',
@sheepeeh
sheepeeh / prepWordForHtml.vb
Last active June 22, 2020 13:51
Get clean HTML from a template-generated Word document (also requires pandoc)
' The final step in the process requires pandoc http://pandoc.org/
' This was designed for our particular Finding Aid template, so some sections might not apply. The ConvertHeadings function, in particular, references a custom style and decrements all Heading sizes by 1.
' Running the prepWordForHtml macro will do the following:
' - Remove all Content Controls (but preserve the content)
' - Convert list numbering to plain text
' - Change Box Heading Style to Heading 3
' - Change Heading 2 to Heading 3
' - Change Heading 1 to Heading 2
' - Delete Captions
' - Delete TOC Heading text
@sheepeeh
sheepeeh / NALDC.js
Last active June 3, 2016 18:27
Zotero translator for http://naldc.nal.usda.gov/naldc/home.xhtml (single items only)
// Currently only creates slightly wonky Report items, as there is no way to identify itemType from the page content.
{
"translatorID": "3f682e1e-a845-41f3-a5e9-4aad993e5090",
"label": "NALDC",
"creator": "Rachel Donahue",
"target": "http://naldc.nal.usda.gov/[\\w-_]*",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
@sheepeeh
sheepeeh / Stack Exchange.js
Created June 6, 2016 15:52
For adding SE questions to Zotero. (No Multi-scraper.)
{
"translatorID": "508a49ba-18cb-4ead-b928-2a7b230450aa",
"label": "Stack Exchange",
"creator": "Rachel Donahue",
"target": "(http)(s)?:\\/\\/(\\w*\\.)?(stack)(overflow|exchange)(\\.com)(\\/questions)(.*)",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
"inRepository": true,
"translatorType": 4,
@sheepeeh
sheepeeh / move_issues.rb
Created January 4, 2017 21:37
"copy" issues from one github repo to another
require 'octokit'
require_relative 'gapi_config'
############################################################################
# Copy issues and comments from one repository to another (sort of). #
# Because there is no way to copy issues directly, this script will #
# create new issues with the original metadata in the issue's body. #
# #
# NOTE: Assignees and issue status are included in the metadata block, #
# but the new issue itself will be open and unassigned. #
@sheepeeh
sheepeeh / copyFromPrevColumn.vbs
Last active March 30, 2020 15:35
Word VBA: Copy text from previous column if current column is empty
' Usage: Select/place your cursor in the cell you want to copy text TO,
' then run the macro. It will loop through all rows, so only select
' one cell.
' The first macro will copy text into blank cells for the currently
' selected table.
'
' The second will do this for the selected columns in all tables
' in the document.
'