Skip to content

Instantly share code, notes, and snippets.

Avatar

Jonathan Reeve JonathanReeve

View GitHub Profile
@JonathanReeve
JonathanReeve / forums-search.php
Created Apr 10, 2014
Hack to Allow Buddypress Search Bar to Search BBPress Forums
View forums-search.php
// Adds BBPress "Forums" select option to Advanced Search. - JR
function mla_bp_search_form_type_select_add_forums($options) {
$options['bbpforums'] = __( 'Forums', 'buddypress' );
return $options;
}
add_filter('bp_search_form_type_select_options', 'mla_bp_search_form_type_select_add_forums');
// Fix forum search handling - JR
function mla_bp_core_action_search_site( $slug = '') {
@JonathanReeve
JonathanReeve / gist:b82a6c27493232bb0216
Last active Aug 29, 2015
Fix bp-groupblog links not working for public blogs of private groups
View gist:b82a6c27493232bb0216
/**
* Override default BP Groupblog nav item functionality
*/
function my_custom_groupblog_setup_nav() {
// only add for groups
if ( !bp_is_group() ) return;
// only act if blog not embedded in group template
$checks = get_site_option('bp_groupblog_blog_defaults_options');
View Stylometry Experiments.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Stylometry Experiments.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Chiaroscuro Detector.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Chiaroscuro Detector.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@JonathanReeve
JonathanReeve / issue-scraper
Created Jan 13, 2015
GitHub issue scraper to print issues from multiple repositories containing a label
View issue-scraper
#Not yet working!
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
import requests
import json
@JonathanReeve
JonathanReeve / git-pull.php
Created Feb 22, 2015
Push to deploy with GitHub. This script performs a "git pull" on a webserver when it receives a webhook post signal from GitHub.
View git-pull.php
<?php
// When used in conjunction with GitHub web hooks, this script listens for
// a signal from GitHub. When GitHub tells us that the master or develop
// branches of our repo have been updated, we change into those directories
// and run `git pull`, which updates our code to the latest version.
function print_log( $log ) {
file_put_contents( 'logs/github.txt', print_r( $log, TRUE ), FILE_APPEND );
}
@JonathanReeve
JonathanReeve / brown-corpus-categories
Created May 3, 2015
Export Brown Corpus categories to text files using NLTK.
View brown-corpus-categories
import nltk
from nltk.corpus import brown
for category in brown.categories():
words = brown.words(categories=category)
text = " ".join(words)
filename = category + '.txt'
outfile = open(filename, 'w')
outfile.write(text)
outfile.close()
View gist:136da2000db87f38ee97e052f9b13ef6
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.