Skip to content

Instantly share code, notes, and snippets.

View patrickmj's full-sized avatar

Patrick Murray-John patrickmj

  • Digital Scholarship Group, Snell Library, Northeastern University
  • Boston, MA
  • X @patrick_mj
View GitHub Profile
@patrickmj
patrickmj / demo gist
Last active August 29, 2015 13:56
Demo gist
<?php
echo "hello gist!"
?>
@patrickmj
patrickmj / hello.rb
Last active January 2, 2016 07:49
My Code Snippet
2.times do
puts "Hello World"
end
require 'octokit'
require 'csv'
require 'date'
# Description:
# Exports Github issues from one or more repos into CSV file formatted for import into JIRA
# Note: By default, all Github comments will be assigned to the JIRA admin, appended with
# a note indicating the Github user who added the comment (since you may not have JIRA users
# created for all your Github users, especially if it is a public/open-source project:
#
require 'json'
require 'open-uri'
require 'csv'
require 'date'
# Github credentials to access your private project
USERNAME="myusername"
PASSWORD="mypassword"
# Project you want to export issues from
"""
Exports Issues from a specified repository to a CSV file
Uses basic authentication (Github username + password) to retrieve Issues
from a repository that username has access to. Supports Github API v3.
"""
import csv
import requests
@patrickmj
patrickmj / Omeka - filter advanced search
Created May 22, 2013 14:24
Filter advanced search options in Omeka
@patrickmj
patrickmj / json.php
Created May 21, 2013 17:08
Sample twitter JSON data to start learning how to import for Boston Marathon project
<?php
$json = '[{"created_at":"Mon Apr 15 18:02:53 +0000 2013","id":323858984949923840,"id_str":"323858984949923840","text":"Random girl next to me in class shows me tweets about me, uuhhhhh okay #thanks?","source":"\u003ca href=\"http:\/\/twitter.com\/download\/android\" rel=\"nofollow\"\u003eTwitter for Android\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":499196071,"id_str":"499196071","name":"KSB","screen_name":"KSVelociraver","location":"","url":null,"description":"Life is short, live each day like your last... no worries","protected":false,"followers_count":41,"friends_count":77,"listed_count":0,"created_at":"Tue Feb 21 21:42:10 +0000 2012","favourites_count":298,"utc_offset":-14400,"time_zone":"Atlantic Time (Canada)","geo_enabled":true,"verified":false,"statuses_count":1360,"lang":"en","contributors_enabled":false,"is_translator":false,"profile_backgr
@patrickmj
patrickmj / characters database
Created September 16, 2012 14:08 — forked from sashaca2/characters database
relational database
-- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 16, 2012 at 04:16 AM
-- Server version: 5.5.25
-- PHP Version: 5.4.4
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
@patrickmj
patrickmj / php-concatenation.php
Created September 10, 2012 00:28
PHP string concatenation tricks for Clio3
<?php
$var = "hi!";
$array = array('uno'=>'one', 'dos'=>'two', 'tres'=>'three', 'quatro'=>'four');
echo "Say Hello: $var"; // outputs 'hi!'
echo "<br/><br/>";
@patrickmj
patrickmj / WPSearchForm.php
Created June 1, 2012 20:16
WP twentyeleven search form code
<?php
// Has the text been hidden?
if ( 'blank' == get_header_textcolor() ) :
?>
<div class="only-search<?php if ( ! empty( $header_image ) ) : ?> with-image<?php endif; ?>">
<?php get_search_form(); ?>
</div>
<?php
else :
?>