Skip to content

Instantly share code, notes, and snippets.

View mjlassila's full-sized avatar

Matti Lassila mjlassila

View GitHub Profile
@mjlassila
mjlassila / keybase.md
Last active October 11, 2017 17:38
keybase.md

Keybase proof

I hereby claim:

  • I am mjlassila on github.
  • I am mjlassila (https://keybase.io/mjlassila) on keybase.
  • I have a public key ASAMEYWfs7tSgHyDXHrOCBerAG-m7yFc3_btuPlI8yzTQwo

To claim this, I am signing this object:

@mjlassila
mjlassila / create-locations.xq
Last active August 10, 2017 12:19
Using Omeka S Mapping API
let $keys:='key_identity=F6JOEdSh8ZJ1CkphDXE9xpgnGkY3ZM1T&key_credential=X8rS6B41TqDTiMrMYLFCjQ1AaBvvy4NQ'
let $search:=function($handle) {
let $url:='http://omekas:8888/api/items?search='|| $handle
return json:parse(fetch:text($url), map {'format':'attributes'})
}
let $create_location:=function($id,$lat,$long,$label) {
let $url:='http://omekas:8888/api/mapping_markers?'||$keys
let $data:=
@mjlassila
mjlassila / HOWTO.md
Last active July 27, 2017 17:26
Autogenerated random target shooting session

On Mac OSX, one can use built-in speech synthesis to generate random-target shooting sessions.

Install randomize-lines -package using Homebrew. This is needed to select random lines from the text file, using reselection.

You'll need a text file with target numbers/shapes/colours, like:

red 1 square  [[slnc 2000]]
square blue 2 [[slnc 5000]]
@mjlassila
mjlassila / bibtex-to-orcid.md
Last active July 18, 2017 06:55
BibTeX entry type to ORCID work types mapping (CASRAI research output types)
BibTeX entry type ORCID work category ORCID work type
article publication journal-article
book publication book
booklet other_output other
conference conference conference-paper
inbook publication book-chapter
incollection publication book-chapter
@mjlassila
mjlassila / ipad-lainaus.Rmd
Last active June 16, 2017 13:22
iPad-laitteiden lainaus Jyväskylän yliopiston kirjastossa
---
title: "iPad-tablettitietokoneiden lainaus Jyväskylän yliopiston kirjastossa"
author: "Matti Lassila"
date: "16.6.2017"
output: html_document
---
```{r setup, echo=FALSE,include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(data.table)
@mjlassila
mjlassila / prepare_bachelor_thesis_data.fix
Last active November 18, 2016 11:00
FIX declarations for cleaning thesis and dissertation data
#- Catmandu FIX script for JYU bachelor thesis data
#- catmandu convert OAI --url http://jyx.jyu.fi/dspace-oai/request --set hdl_123456789_18536 --format qdc_finna to JSON > jyx-kandi.json
move_field('creator','first_authors');
trim('first_authors');
move_field('contributor','second_authors');
trim('second_authors');
move_field('language','languages.$append',join:"###");
split_field('languages.*','###');
flatten('languages');
@mjlassila
mjlassila / gpoint.php
Created October 12, 2016 10:21 — forked from cypres/gpoint.php
PHP class to convert Latitude & Longitude coordinates into UTM & Lambert Conic Conformal Northing/Easting coordinates.
<?php
/**
* PHP class to convert Latitude & Longitude coordinates into UTM & Lambert Conic Conformal Northing/Easting coordinates.
*
* This class encapsulates the methods for representing a geographic point on the earth in three different coordinate systema. Lat/Long, UTM and Lambert Conic Conformal.
*
* Code for datum and UTM conversion was converted from C++ code written by Chuck Gantz (chuck.gantz@globalstar.com) from http://www.gpsy.com/gpsinfo/geotoutm/
* This code was converted into PHP by Brenor Brophy (brenor@sbcglobal.net) and later refactored for PHP 5.3 by Hans Duedal (hd@onlinecity.dk).
*
@mjlassila
mjlassila / custom.css
Last active October 6, 2016 10:59
Ylimääräisten tietojen piilottaminen Finnan aukioloaika-widgetistä
/* Kansalliskirjaston aukioloaikasovelma */
.extra-organisation-info,
.organisation-info-dropdown {
display: none;
}
.organisation-info .info .opening-times-week .day-container .time-row .date {
width: 20%;
}
@mjlassila
mjlassila / Factory.php
Last active September 26, 2018 13:46
Artikkelitilaustoiminto Varastokirjastoon
<?php
/**
* Factory for controllers.
*
* PHP version 5
*
* Copyright (C) The National Library of Finland 2015.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
@mjlassila
mjlassila / book-usage-in-period.Rmd
Created June 8, 2016 14:13
RMarkdown document for creating book usage report from Voyager
---
title: "Lainaus ja varausraportti"
date: "8.6 2016"
output: html_document
---
```{r setup, include=FALSE, echo=FALSE}
knitr::opts_chunk$set(echo = FALSE, warning = FALSE)
Sys.setlocale("LC_ALL","fi_FI.UTF-8")
require(data.table)