Skip to content

Instantly share code, notes, and snippets.

@emasters
emasters / CommentPressOnClasscaster.md
Last active December 17, 2015 04:59
Using CommentPress on CALI Classcaster

Using CommentPress on Classcaster

CommentPress is a special theme and plugin for Wordpress that allows you to create a Classcaster blog with social commenting features.

CommentPress Core is an open source theme and plugin for WordPress that allows readers to comment paragraph-by-paragraph, line-by-line or block-by-block in the margins of a text.

Annotate, gloss, workshop, debate: with CommentPress Core you can do all of these things on a finer-grained level, turning a document into a conversation. It can be applied to a fixed document (paper/essay/book etc.) or to a running blog.

Please note that because CommentPress is a complex theme and plugin combo it should be used with a new blog. If you activate CommentPress on an existing blog bad things will happen.

@emasters
emasters / GTWForm.inc
Created September 10, 2013 20:11
This is a basic form for registering for a GoToWebinar webinar. The code can be pasted into a page and it will work. It needs to have the webinar key inserted where indicated. You can get the key from the GTW URL, it is the number that makes up the final element of the registration URL. Some fun styling has been added so the forms look neat on w…
<form action="https://www2.gotomeeting.com/en_US/island/webinar/registration.flow" method="post" name="webinarRegistrationForm">
<div id="regParent" class="regFields">
<input type="hidden" name="Template" value="island/webinar/registration.tmpl">
<input type="hidden" name="Form" value="webinarRegistrationForm">
<input type="hidden" name="WebinarKey" value="##INSERT WEBINAR KEY HERE##">
<input type="hidden" name="ViewArchivedWebinar" value="false">
<input type="hidden" name="registrant" value="">
<input type="hidden" name="RegistrantTimeZoneKey" id="RegistrantTimeZoneKey" value="64">
<div class="formRow">
<span class="error">*</span><label for="Name_First">First Name: </label> <input type="text" name="Name_First" id="Name_First" value="" maxlength="128" class="fis">
@emasters
emasters / linkchecker.php
Created September 27, 2013 19:56
Load this in a browser and give it a page to with a lot of links on it and it will parse the list and check the links. It is hard coded to check 100 links. If you need more, just edit the page. Requires cURL. I found the script at http://www.innvo.com/c/PHP/1278786173-PHP-broken-link-checker.
<?php
class html_parser
{
// A function to convert relative links to absolute links
public function rel2abs($rel,$base)
{
@$p = parse_url($rel);
if(!$rel)
RETURN $base;
if(isset($p['scheme']) && $p['scheme'])
@emasters
emasters / OGEntity
Last active April 25, 2018 14:41
This array represents an Organic Group entity in Drupal 7.
[10349] => stdClass Object (
[vid] => 10518
[uid] => 1
[title] => Legal Research Community Authority Project - LRCAP
[log] =>
[status] => 1
[comment] => 2
[promote] => 1
[sticky] => 0
[nid] => 10349
@emasters
emasters / README.md
Last active August 29, 2015 14:09 — forked from oodavid/README.md

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@emasters
emasters / mailman.ini
Created December 10, 2014 11:56
Mailman - Nginx - Uwsgi
[uwsgi]
master = True
touch-reload = %p
daemonize = /var/log/uwsgi-mailman.log
# make sure pid file is readable and writable by uid listed below
pidfile = /tmp/uwsgi-mailman.pid
log-maxsize = 20971520
#port to listen on
@emasters
emasters / statetaxonomy.php
Created June 22, 2015 15:54
Create a states taxonomy
function create_states() {
$state_list = array('AL'=>"Alabama",
'AK'=>"Alaska",
'AZ'=>"Arizona",
'AR'=>"Arkansas",
'CA'=>"California",
'CO'=>"Colorado",
'CT'=>"Connecticut",
'DE'=>"Delaware",
@emasters
emasters / A2JFileInfo.php
Last active February 23, 2016 15:06
Minimal A2J GI uploading
<?php
/**
* 2/22/2016 ERM
* every upload has a Guide.xml file. Let's display it.
**/
header('Content-type: text/xml');
chdir($_GET['UploadDir']);
$xml = simplexml_load_file('Guide.xml');
echo $xml->asXML();
?>
<?php
error_reporting(E_ALL);
session_start();
$UploadFolder = "../guides/";
if (($tempName=$_FILES['file']['tmp_name'])!="")
{
//logmsg("tempName=$tempName");
@emasters
emasters / capapi.php
Last active November 2, 2018 18:32
First swipe at using the CAP API to retreive a the full text of a case.
<?php
/**
* Working with Harvard's CAP API
*
*/
$authorization = "Token your-API-key-here";
$cite = "309 F.2d 912";
$full_case = "true";
$body_format = "html";