Skip to content

Instantly share code, notes, and snippets.

@ConnorWGarvey
ConnorWGarvey / pomdepstogradle.groovy
Created April 2, 2012 21:21
Convert pom dependencies to Gradle
#! /usr/bin/env groovy
def project = new XmlSlurper().parse(new File('pom.xml'))
def versionNodes = project.properties.children().findAll { it.name().endsWith('.version') }
def versions = [:]
for (versionNode in versionNodes) {
versions[versionNode.name()] = versionNode.text()
}
for (dependency in project.dependencies.dependency) {
print " compile('${dependency.groupId.text()}:${dependency.artifactId.text()}:"
@ConnorWGarvey
ConnorWGarvey / mapvaluetiming
Created July 6, 2012 19:59
When are map values evaluated in Groovy?
#! /usr/bin/env groovy
def i = 1
def map = [value:i]
i = i + 1
println map
@ConnorWGarvey
ConnorWGarvey / StaxRip log
Created January 6, 2013 04:14
It seems like only for large files, something fails and the video is sent through FFVideoSource instead of DGSource. I noticed that in the avs file, an mkv was passed in, but it seems like DGSource wants the dgi.
------------------------------------------------------------
Environment
------------------------------------------------------------
StaxRip version: 1.1.8.0
OS Name : Windows 8 Pro
OS Version : 6.2.9200.0
OS Type : 64-bit
OS Culture : English (United States)
@ConnorWGarvey
ConnorWGarvey / hubot-irc-commands.coffee
Last active December 20, 2015 06:59
IRC commands for Hubot
# Description:
# Anyone can have voice or op
#
# Commands:
# hubot make me an op
# hubot make <name> an op
# hubot give me voice
# hubot give <name> voice
module.exports = (robot) ->
@ConnorWGarvey
ConnorWGarvey / headphones
Last active February 2, 2023 22:28
Every new version of BlueMan or PulseAudio on Ubuntu breaks my Bluetooth headphones in new ways. Lately, I have to connect, set the profile to "off", set the profile to "headset", disconnect, reconnect, set the profile to "high fidelity audio". Here's a script that does all of that. Put it on your path and run "headphones".
#!/usr/bin/env ruby
# Requires these libraries
#
# $ gem install colorize, open4
# sudo service bluetooth restart
# or
# sudo /etc/init.d/bluetooth restart
@ConnorWGarvey
ConnorWGarvey / download
Last active April 26, 2018 22:03
Flickr Downloader
#!/usr/bin/env ruby
require 'fileutils'
require 'flickraw'
require 'open-uri'
require 'set'
require 'zaru'
def download_page(destination_dir:, page:)
count = 0
@ConnorWGarvey
ConnorWGarvey / indented-list-item.md
Last active January 26, 2024 06:47
Indented list line break example

Line breaks using backslashes

* List item
    * Indented list item 1\
      item 1 line two\
      item 1 line three
    * Indented list item 2
@ConnorWGarvey
ConnorWGarvey / .vimrc
Created January 30, 2023 21:11
My .vimrc
" 'nocompatible' is the default for user .vimrcs. Consider setting it for a shared file. https://vimdoc.sourceforge.net/htmldoc/starting.html#compatible-default
"set nocompatible
" Auto-indentation on for known file types.
if has('filetype')
filetype indent plugin on
endif
" Syntax highlighting
if has('syntax')