docker-machine start
eval "$(docker-machine env default)
Browsers generally work with HTML or the XML compatible variant, XHTML. However, they can also support XML, with some caveats. Xcential makes use of this in the LegisPro editor, to display and edit XML directly. We also use it to render XML in the browser with CSS, avoiding costly transformations to HTML.
To style XML, you need to add links to stylesheets (embedded styles may be supported, but not explicitly by the XML specification): https://www.w3.org/Style/styling-XML.en.html
For example, the attached bill.xml is styled with two css files. Place them in the same directory as bill.xml and open bill.xml in a browser. Generally, Firefox works best for this.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Notes on converting GDoc to Asciidoctor | |
## GDoc to AsciiDoctor using Java + Google APIs | |
This method is described here as experimental. I did not try it: https://github.com/maxandersen/gdoc2adoc | |
## GDoc to AsciiDoctor script | |
This method uses a Google Apps script, which adds a menu to your Google Docs. The script and instructions are here: | |
https://github.com/maxandersen/gdoc2adoc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var argv = require('yargs') | |
.usage('Usage: $0 <command> [options]') | |
.command('convert', 'Convert bills (e.g. with XSLT)') | |
.example('$0 convert -a', 'Convert all bills for the current congress') | |
.example('$0 convert -b 116hr200', 'Convert bills for 116hr200enr') | |
.example('$0 convert -b 116hr200 116hr144', 'Convert bills for 116hr200enr and 116hr144') | |
.option('a', { | |
description: 'All bills for one congress (defaults to current congress)', | |
alias: 'all' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import string | |
myletters = string.ascii_letters + '!@#$%^&*' + '0123456789' | |
def randString(stringLength): | |
return ''.join(random.choice(myletters) for i in range(stringLength)) | |
def getNRandStrings(n, m): | |
return [randString(n) for item in range(m)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// String to Blob | |
// https://stackoverflow.com/q/23024460/628748 | |
const cssString = "selector{},..."; | |
const cssBlob = new Blob([cssString], { | |
type: 'text/plain' | |
}); | |
// Blob to File | |
// https://stackoverflow.com/a/48750233/628748 | |
cssBlob.lastModifiedDate = new Date(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python3 | |
# -*- coding: utf-8 -*- | |
'Scrape USC release points' | |
# Sample release point link: https://uscode.house.gov/download/releasepoints/us/pl/115/239not232/[email protected] | |
# TODO download *all* of the first release point (to createa baseline) | |
# TODO add current release point, linked from https://uscode.house.gov/download/download.shtml, | |
# e.g. https://uscode.house.gov/download/releasepoints/us/pl/116/65/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream nodeservice { | |
server 127.0.0.1:8091; | |
} | |
server { | |
listen 4200 default_server; | |
listen [::]:4200 default_server; | |
server_name localhost; | |
# Load configuration files for the default server block. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Uses the alertify library for notifications; any notification mechanism can be substituted | |
// The file to upload must be in an `input` element with @id = constants.DOC_UPLOAD_ID | |
// The name of the file is in uploadDocName, which is set from user input | |
let docUpload = function (uploadDocName) { | |
if(!uploadDocName){ | |
alertify.error('Document name is required'); | |
return | |
} | |
if(!validateDocName(uploadDocName)){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//document.querySelectorAll('[amendment]').setAttribute('isclassified', false); | |
document.querySelectorAll('[amendment]').forEach(item => item.removeAttribute('activeamendment')); | |
//THEN | |
//document.querySelectorAll('[amendment="selectedamendmentid"]').forEach(item => setAttribute('activeamendment', true)); | |
document.querySelectorAll('[amendment="HB819FDEA29674204ABD2698D5DEED62F"]').setAttribute('activeamendment', true); | |