Skip to content

Instantly share code, notes, and snippets.

View jonespm's full-sized avatar
🥊
"Sometimes you get the bug, sometimes the bug gets lucky!"

Code Hugger (Matthew Jones) jonespm

🥊
"Sometimes you get the bug, sometimes the bug gets lucky!"
View GitHub Profile
@jonespm
jonespm / sakai_loc.txt
Created November 10, 2019 17:00
Sakai Total LOC as of 11/10/2019
Statistics based on HEAD
Active files: 14,643
Active lines: 2,390,383
Total commits: 42,603
Note: Files matching MIME type image, binary has been ignored
+------------------------------+---------+---------+-------+--------------------+
| name | loc | commits | files | distribution (%) |
+------------------------------+---------+---------+-------+--------------------+
@jonespm
jonespm / gitpr.zsh
Created September 6, 2019 13:38
Git alias to checkout someone elses PR
gitpr() {
GIT=`which -p git`
if [ "$1" ]; then
if [ "$2" ]; then
command $GIT fetch upstream pull/$1/head:$2
command $GIT checkout $2
else
echo "You need to specify two parameters, gitpr <PR #> <BRANCHNAME>"
fi
else
@jonespm
jonespm / test1.json
Created June 25, 2019 14:41
Tests for json MyLA config
{
"/* Required to set this with some value": "*/",
"/* Run the code here to generate https://raw.githubusercontent.com/openwisp/ansible-openwisp2/master/files/generate_django_secret_key.py": "*/",
"DJANGO_SECRET_KEY": "<Generate Secret Key>",
"/* Set the Timezone for the container (must rebuild if changed)": "*/",
"TZ": "America/Detroit",
"/* CSV List of hosts allowed, no spaces in between commas": "*/",
"ALLOWED_HOSTS": [
"127.0.0.1",
"localhost"
var oauth = require('oauth-sign');
var action = 'https://lti.tools/saltire/tp';
var method = 'POST';
var timestamp = Math.round(Date.now() / 1000);
var params = {
// LTI Required Parameters
lti_message_type: 'basic-lti-launch-request',
lti_version: 'LTI-1p0',
resource_link_id: 'resourceLinkId',
// OAuth 1.0a Required Parameters
@jonespm
jonespm / filtercatalina.sh
Created August 22, 2016 15:15
Filter startup logs
cat catalina.out | grep startStop | awk {'print $3 "," $5'} | sort > filtered-catalina.csv
cat filtered-catalina.csv | grep -v detected | awk -F\. {'print $1"."$2"."$3'} > filtered-catalina2.csv
#!/bin/zsh
# Run a script repeatedly until fail
# Idea from http://stackoverflow.com/questions/12967232/repeatedly-run-a-shell-command-until-it-fails
# If this is in your home dir you can just run it as
# ~/untilfail.sh "some command to run". Running maven tests are good ones
# ~/untilfail.sh "mvn test -Dtest=org.sakaiproject.sitestats.test.StatsUpdateManagerTest"
#shopt -s expand_aliases
#I have important functions and aliases in here
source ${HOME}/.zshrc
@jonespm
jonespm / gist:a95dcb84938d8f6f0632
Last active August 29, 2015 14:16
getAssignmentWithStats
public List getAssignmentsWithStats(final Long gradebookId, final String sortBy, final boolean ascending) {
return getAssignmentsWithStats(gradebookId, sortBy, ascending, false);
}
/**
*/
public List getAssignmentsWithStats(final Long gradebookId, final String sortBy, final boolean ascending, final boolean includeDroppedScores) {
Set studentUids = getAllStudentUids(getGradebookUid(gradebookId));
List<AssignmentGradeRecord> gradeRecords = getAllAssignmentGradeRecords(gradebookId, studentUids);
if(!includeDroppedScores) {
#!/usr/bin/env ruby
# Run like
# mvn com.ning.maven.plugins:maven-duplicate-finder-plugin:1.0.9:check > duplicates.txt
# cat duplicates.txt| ./duplicateparse.rb > parsedoutput.txt
tool=""
toolh=Hash.new
ARGF.each do |line|
#print line without the new line if line does not contain /--+/
if (line =~ /\[INFO\] Building (.*)/)

Releasing sakai involves changing versions and creating tags and deploying artifacts to maven repo's.

Versioning the new version

For this task we will leverage the maven versions plugin http://mojo.codehaus.org/versions-maven-plugin/ When a branch is ready to be made a version the first thing is to update versions

In order to ensure all the versions were updated accuratley its important to find out how many versions there currently are with something like: