Skip to content

Instantly share code, notes, and snippets.

@jm2dev
jm2dev / MavenTomcatJettyCustomized.xml
Created June 29, 2011 09:21
Maven tomcat and jetty plugins
<project>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.25</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<stopPort>9966</stopPort>
<stopKey>foo</stopKey>
@jm2dev
jm2dev / ShibbolethMetadata2OpenAM.xqy
Created September 4, 2012 23:36
Extract EntityDescriptor from Shibboleth bulk metadata file and remove Extensions nodes
xquery version "1.0-ml";
declare namespace html = "http://www.w3.org/1999/xhtml";
declare namespace a = "urn:oasis:names:tc:SAML:2.0:metadata";
<EntityDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:mdrpi="urn:oasis:names:tc:SAML:metadata:rpi"
xmlns:mdui="urn:oasis:names:tc:SAML:metadata:ui"
xmlns:shibmd="urn:mace:shibboleth:metadata:1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@jm2dev
jm2dev / orgmode-to-docbook-fo-pdf
Created January 14, 2013 22:55
Settings to allow emacs org-mode export a pdf file via xslt (saxon) fo (fop) toolchain in OSX.
(require 'org-docbook)
;;
(setq org-export-docbook-xsl-fo-proc-command "/usr/local/bin/fop \"%i\" \"%o\"")
(setq org-export-docbook-xslt-proc-command "/usr/local/bin/saxon -o:\"%o\" -s:\"%i\" -xsl:\"%s\"")
(setq org-export-docbook-xslt-stylesheet "/usr/local/Cellar/docbook/5.0/docbook/xsl-ns/1.77.1/fo/docbook.xsl")

Advanced Functional Programming with Scala - Notes

Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@jm2dev
jm2dev / Makefile.ansible
Last active September 24, 2020 11:03
Make tasks for ansible.
help: ## Print this help
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
setup: ## python virtual environment
python3 -m venv .venv
VIRTUAL_ENV_DISABLE_PROMPT=true source .venv/bin/activate;\
pip install --upgrade pip;\
pip install -r requirements.txt
playbook=archlinux-workstation.yml
@jm2dev
jm2dev / baraction.sh
Created October 13, 2020 04:54
Spectrwm configuration
#!/usr/bin/env bash
#set -euo pipefail
trap 'Update' 5
spr='|'
VolInf()
{
# I had to move this function to it's own script