Skip to content

Instantly share code, notes, and snippets.

@ori229
ori229 / allDataInXmlToTable.xsl
Created March 17, 2024 05:45
XSL that retrieves all fields in an XML, and shows the full path of the field and its data
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<style>
table, th, td {
border: 1px solid black; border-collapse: collapse; width:100%;
}
@ori229
ori229 / call_update_bib_api.php
Created January 9, 2024 20:12
Demo Alma's Update-Record API using PHP
<?php
$url = "https://api-na.hosted.exlibrisgroup.com/almaws/v1/bibs/99374837900561?apikey=l7xx0e4...";
echo "Calling $url ...\n";
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, FALSE);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/xml'));
$data = '
@ori229
ori229 / SftpWithPrivateKey.java
Last active November 13, 2022 08:36
Java access to SFTP with a private key
import java.util.Vector;
import com.jcraft.jsch.Channel;
import com.jcraft.jsch.ChannelSftp;
import com.jcraft.jsch.ChannelSftp.LsEntry;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
import com.jcraft.jsch.SftpATTRS;
import com.jcraft.jsch.SftpException;
@ori229
ori229 / AddUsersToAlmaFromExcel.ps1
Last active May 31, 2020 20:30
Add Users To Alma From Excel file
<#
.SYNOPSIS
Creating an input file of users for uploading to Alma.
Details in https://developers.exlibrisgroup.com/blog/uploading-users-from-excel-file-using-powershell/
#>
Set-StrictMode -Version Latest
#define SIZE 26
// See demo in https://youtu.be/vD1pToPe5N4
String letters[SIZE]={
// A to I
".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..",
// J to R
".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-", ".-.",
// S to Z
@ori229
ori229 / 1.conf
Created July 26, 2017 13:44
Simple survey - server side perl
01_q:
בכל השאלות אחד פירושו בכלל לא, וחמש פירושו ממש כן. ניתן לדלג על שאלות כאשר לא מעוניינים לענות או כאשר לא יודעים. שאלה ראשונה: מרגיש טוב היום?
02_q:
מאושר בחיים?
03_q:
אין כמו ארץ ישראל
04_q:
מטרה מרכזית לעבודה - כסף
05_q:
אם היה אפשר לקבל את המשכורת בלי לעבוד עדיין הייתי בא לעבודה
@ori229
ori229 / AngularJS_http_GET_Alma.html
Last active May 10, 2016 11:43
Demo - calling Alma APIs using AngularJS - http.get/ngResource
<!doctype html>
<html ng-app="exampleApp">
<head>
<meta charset="UTF-8">
<title>Example - GET using AngularJS</title>
<!-- based on http://www.apress.com/9781430264484 listing 20-3 -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js"></script>
<script>
angular.module("exampleApp", [])
.controller("defaultCtrl", function ($scope, $http) {