Skip to content

Instantly share code, notes, and snippets.

View eulereadgbe's full-sized avatar

Elvi Nemiz eulereadgbe

  • Southeast Asian Fisheries Development Center, Aquaculture Department
View GitHub Profile
@eulereadgbe
eulereadgbe / scopus-citecounts.js
Last active July 27, 2016 07:16
Scopus citation counts in DSpace xmlui modified from https://gist.github.com/aschweer/6772579
/*
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
callbackCitedbycount = function(){
if (sciverse.areSearchResultsValid()) {
var resultObj = sciverse.getSearchResults();
@eulereadgbe
eulereadgbe / snippet-truncate-text.js
Last active August 12, 2016 08:41
Integration of jquery dotdotdot plugin to abstracts
$('.truncable-txt').append('<span class="read-more trigger-js">&#160;<a class="read-more__txt small">[+] Show more</a></span>' +
'<span class="read-less trigger-js">&#160;<a class="read-less__txt small">[-] Show less</a></span>');
var bindReadMore = function(){
$('.read-more').on('click', function(e) {
e.preventDefault();
var parent = $(this).parent();
parent.trigger("destroy");
parent.removeClass('truncable-txt--is-truncated');
parent.addClass('truncable-txt--is-not-truncated');
@eulereadgbe
eulereadgbe / how_to_keep_a_git_branch_up_to_date.txt
Created July 5, 2017 02:04 — forked from hardyoyo/how_to_keep_a_git_branch_up_to_date.txt
How to keep a git branch up to date with an upstream master branch.
git fetch --all
git checkout master #may have to git stash first, but, don't forget, you need to be ON THE MASTER BRANCH before you proceed
git pull upstream master
git push origin master
git pull origin master #not necessary but a nice sanity check
git checkout BRANCHNAME
git rebase -i master
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import requests
import json
import xml.etree.ElementTree as ElementTree
from javax.servlet.http import HttpServlet
from net.sf.ehcache import Cache;
@eulereadgbe
eulereadgbe / asfa.xslt
Last active October 20, 2019 17:54
XSLT to transform ASFA Thesaurus to DSpace controlled vocabulary
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:key name="kConcByCode" match="CONCEPT" use="DESCRIPTOR"/>
<xsl:key name="useFor" match="CONCEPT" use="NON-DESCRIPTOR"/>
<xsl:template match="/">
<node id="ASFA" label="ASFA Thesaurus">
<isComposedBy>
@eulereadgbe
eulereadgbe / WaterMark.java
Created October 5, 2017 06:27
Mediafilter to create diagonal watermarks with Java
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
package org.dspace.app.mediafilter;
import org.dspace.core.ConfigurationManager;
@eulereadgbe
eulereadgbe / WaterMark.java
Created November 28, 2017 03:16
Media filter to create watermarked image
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
package org.dspace.app.mediafilter;
import org.dspace.core.ConfigurationManager;
@eulereadgbe
eulereadgbe / navigation.xsl
Created September 6, 2018 09:46
Additional sidebar menu
<!--
The contents of this file are subject to the license and copyright
detailed in the LICENSE and NOTICE files at the root of the source
tree and available online at
http://www.dspace.org/license/
-->
//DSpace 5
select
h.handle,
rp.policy_id,
bit.sequence_id,
bitmv.text_value,
bit.internal_id,
brp.policy_id
from handle h
join item i
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();