Skip to content

Instantly share code, notes, and snippets.

@maxmarkus
maxmarkus / pre-commit-hook-merge-conflicts.sh
Created March 24, 2016 13:26
Git pre-commit hook to prevent checking in non-resolved merge conflicts.
#!/bin/bash
# Check for merge conflicts
# Tested on Linux and Mac
# Simple check for merge conflics
conflicts=`git diff --cached --name-only -G"<<<<<|=====|>>>>>"`
@serge1
serge1 / input.xml
Last active August 30, 2022 19:24
XSLT Transform by simple Java code
import javax.xml.transform.*;
import javax.xml.XMLConstants;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import java.io.File;
public class XsltTransform {
public static void main(String[] args) throws TransformerException {
Source xslt = new StreamSource(new File(args[0]));
Source xml = new StreamSource(new File(args[1]));
@wandernauta
wandernauta / sp
Last active May 26, 2024 16:02
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/usr/bin/env bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#