Skip to content

Instantly share code, notes, and snippets.

View david-hosier's full-sized avatar

David Hosier david-hosier

  • Air Filter Supply
  • Folsom, CA
View GitHub Profile
@david-hosier
david-hosier / log4j.groovy
Last active December 17, 2020 17:54
This gist shows how to use an injected Log4j logger in a Groovy script. Note that the injection only works on a class. This is an example of using Log4j2 with the latest version as the time of writing. If the log4j2.xml file lives in the same directory as the script, it will automatically be used to configure logging. Inspired by https://stackov…
@Grab(group='org.apache.logging.log4j', module='log4j-core', version='2.14.0')
@Grab(group='org.apache.logging.log4j', module='log4j-api', version='2.14.0')
import org.apache.log4j.*
import groovy.util.logging.*
@Log4j2
class LoggingTest {
def execute() {
@david-hosier
david-hosier / WebViewWithActivityIndicator.swift
Last active October 31, 2023 04:15
Shows a ViewController that contains a WKWebView and UIActivityIndicatorView. This is a pruned down snippet from working code that may or may not work exactly as-is, but should give the basic idea of how to show/hide an activity indicator while a WKWebView is navigating to a URL. The original project this was adapted from was done in XCode 8, an…
import Foundation
import UIKit
import WebKit
class ViewController: UIViewController, WKNavigationDelegate, WKUIDelegate {
var webView: WKWebView!
var activityIndicator: UIActivityIndicatorView!
@IBOutlet var webViewContainer: UIView!
@david-hosier
david-hosier / osx-10.10-setup.md
Created November 3, 2015 07:10 — forked from kevinelliott/osx-10.10-setup.md
Mac OS X 10.10 Yosemite Setup

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

@david-hosier
david-hosier / gist:ec82033159652f4add70
Last active August 29, 2015 14:09 — forked from sergeimuller/gist:2916697
Helpful CQ Curl Commands
Note 1: The following CQ curl commands assumes a admin:admin username and password.
Note 2: For Windows/Powershell users: use two "" when doing a -F cURL command.
Example: -F"":operation=delete""
Note 3: Quotes around name of package (or name of zip file, or jar) should be included.
Uninstall a bundle (use http://localhost:4505/system/console/bundles to access the Apache Felix web console)
curl -u admin:admin -daction=uninstall http://localhost:4505/system/console/bundles/"name of bundle"
Install a bundle
curl -u admin:admin -F action=install -F bundlestartlevel=20 -F