Skip to content

Instantly share code, notes, and snippets.

View jburwell's full-sized avatar

John Burwell jburwell

View GitHub Profile
@jburwell
jburwell / Files.java
Last active July 23, 2018 16:36
Guava Idioms
package net.cockamamy.playpen.utils;
import static java.lang.String.format;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
public final class Files {
public static File openFile(final File aParentDirectory, final String aFileName) {
@jburwell
jburwell / provision-laptop.ps1
Last active February 25, 2023 11:03
Windows 10 Configuration
[CmdLetBinding()]
Param([switch] $FullInstall)
Set-StrictMode -Version "2.0"
$logFile = "provision." + (Get-Date -Format FileDateTime) + ".log"
# TODO Add output timestamps
function Log-Message {
[CmdLetBinding()]
@jburwell
jburwell / custom_config.txt
Last active June 6, 2018 15:53
Raspian GPG key generation setup
# To use a custom base config.txt:
# Place the config.txt in this folder.
# It will be used as base for the further customization by installer-config.txt.
display_hdmi_rotate=3
gpu_mem=32
[user]
name = John Burwell
email = meaux@cockamamy.net
[credential]
helper = osxkeychain
[github]
user = jburwell
[push]
default = current
[color]
@jburwell
jburwell / pacman.py
Created June 5, 2017 20:56
Ansible module import
#!/usr/bin/python -tt
# -*- coding: utf-8 -*-
# (c) 2012, Afterburn <http://github.com/afterburn>
# (c) 2013, Aaron Bull Schaefer <aaron@elasticdog.com>
# (c) 2015, Indrajit Raychaudhuri <irc+code@indrajit.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
buildscript {
repositories {
flatDir dirs: "../gradle-javarepl-plugin/build/libs"
}
dependencies {
classpath "net.cockamamy.gradle:gradle-javarepl-plugin:0.1.0"
}
}
apply plugin: "net.cockamamy.gradle.javarepl"
#!/bin/bash -x
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
public final class ExceptionHandling {
private static void throwExceptionInFinallyBlock() {
try {
System.out.println("Doing the do ...");
} catch (Exception e) {
@jburwell
jburwell / TestAppender.java
Last active April 20, 2016 20:25
Test Appender
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
innodb_rollback_on_timeout=1