Skip to content

Instantly share code, notes, and snippets.

@sparsick
sparsick / groovy-pom.xml
Last active August 17, 2020 09:29
Maven POM Template for Groovy Projects
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>my.group.id</groupId>
<artifactId>my.artifact.id</artifactId>
<version>1.0.0-SNAPSHOT</version>
@jandrewthompson
jandrewthompson / dock.sh
Created February 22, 2013 14:22
xrandr scripts for docking and undocking my Dell laptop. I mapped these to global keyboard shortcuts in KDE.
#!/bin/bash
xrandr --output HDMI3 --auto;
sleep 5;
xrandr --output LVDS1 --off;
sleep 5;
xrandr --output VGA1 --right-of HDMI3 --auto --primary;
@rpavlik
rpavlik / twitter-to-google-reader-compiled.js
Last active December 11, 2015 07:29
I'm not a regular twitter user, and it's too annoying to manually create the rss feed url for the twitter feeds I do want to follow in Google Reader. Their bookmarklet doesn't get the job done, but this one (twitter-specific) does. Just bookmark the "compiled" version.
javascript:(function(){var%20canonical%3D%22%22%3Bvar%20links%3Ddocument.getElementsByTagName(%22link%22)%3Bfor(var%20i%3D0%3Bi%3Clinks.length%3Bi%2B%2B)%7Bif(links%5Bi%5D.getAttribute(%22rel%22)%3D%3D%3D%22canonical%22)%7Bvoid(canonical%3Dlinks%5Bi%5D.getAttribute(%22href%22))%7D%7Dif(canonical)%7Bvar%20feed%3D%22https%3A%2F%2Fapi.twitter.com%2F1%2Fstatuses%2Fuser_timeline.rss%3Fscreen_name%3D%22%2Bcanonical.substr(canonical.lastIndexOf('%2F')%2B1)%3Blocation%3D'http%3A%2F%2Fwww.google.com%2Freader%2Fview%2Ffeed%2F'%2BencodeURIComponent(feed)%7D})();
@rplevy
rplevy / two-useful-macros.clj
Created June 29, 2012 23:29
with and within
(defmacro with
"do things with the first expression passed,
and produce the result"
[expr & body]
`(let [~'% ~expr] ~@body))
(defmacro within
"do things with the first expression passed (for side effects),
but produce the value of the first expression"
[expr & body]