Skip to content

Instantly share code, notes, and snippets.

View mcrider's full-sized avatar

Matt Crider mcrider

View GitHub Profile
@mcrider
mcrider / urlInDiv.tpl
Created July 7, 2011 00:53
hack to reload a grid
{**
* urlInDiv.tpl
*
* Copyright (c) 2000-2011 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* Generate JS and HTML to include a URL in a DIV, AJAX-style.
*
*}
@mcrider
mcrider / gist:1135506
Created August 9, 2011 23:44
Proposed schema for notifciation mailing list schema
<!--
*
* TABLE notification_mail_list
*
-->
<table name="notification_mail_list">
<field name="subscription_id" type="I8">
<KEY />
<AUTOINCREMENT/>
</field>
@mcrider
mcrider / gist:1142877
Created August 12, 2011 20:06
Workflow header with user toggle-able stage participant grid
{**
* templates/workflow/header.tpl
*
* Copyright (c) 2003-2011 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* Header that contains details about the submission
*}
<div class="pkp_submissionHeader">
@mcrider
mcrider / OAKPlugin.inc.php
Created April 30, 2012 17:54
Testing OAK plugin
<?php
/**
* @file plugins/generic/oak/OAKPlugin.inc.php
*
* Copyright (c) 2003-2010 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @class OAK
* @ingroup plugins_generic_oak
@mcrider
mcrider / botAgents.txt
Created July 11, 2012 20:33
List of bot agents
# This file contains a list, one per line, of regular expressions to be applied
# to browser user agents to determine whether or not the browser is a "bot" or
# not (i.e. should not be counted in article view counts). If any regexp
# matches, the browser will be considered a bot.
/008/
/ABACHOBot/
/Accoona\-AI\-Agent/
/AddSugarSpiderBot/
/AnyApexBot/
@mcrider
mcrider / index.php
Created September 5, 2012 21:09 — forked from mattbenic/index.php
PHP script to bulk import issues to a GitHub repo from a .json file
<?php
/* PHP script to bulk import issues in json format from a file to a GitHub repository
*
* The json in the uploaded file should contain an array of issues at the top level.
* Fields in the json mapped to the issue title and body (nothing else is supported)
* are specified in the submission form.
*
* Depends on the php-github-api from here: https://github.com/ornicar/php-github-api
*/
@mcrider
mcrider / bugzillaJSONFetch.php
Created September 7, 2012 21:04
Fetch bugs from a bugzilla instance and display in JSON format
<?php
/*
* Fetch open bugs from a bugzilla database and insert them into github bugs
* TODO: Format in a way Github likes (see http://developer.github.com/v3/issues/)
* TODO: Feed into import script (see https://gist.github.com/1816061)
* NOTE: Need to lookup github usernames by email. Not sure if comments will be accepted if the user is not authenticated
* Written by Matt Crider (github: mcrider)
*/
@mcrider
mcrider / cvson.json
Created October 20, 2012 22:51
Example CV JSON
{
"firstName": "Reginald",
"lastName": "Fake",
"gender": "Male",
"dob":"1983-01-01",
"email":"fakeEmail@gmail.com",
"address": {
"streetAddress": "21 Fake Street",
"city": "New York City",
"state": "NY",
@mcrider
mcrider / deleteInterests.php
Last active December 10, 2015 06:18
Remove a list of spam words from the user interest database in OJS
<?php
/** This version works on 2.2.x versions of OJS.
* The ways interests are stored has changed a lot so tweaks will need to be made depending on the version of OJS
The following method needs to be added to lib/pkp/classes/user/InterestDAO.inc.php
function getInterestObjects($userId) {
$interests = $this->build($userId);
$interestEntryDao =& DAORegistry::getDAO('InterestEntryDAO');
#!/usr/bin/env ruby
require 'rubygems'
require 'FasterCSV'
require 'httparty'
require 'json'
class GitHub
include HTTParty
base_uri 'https://api.github.com'