Skip to content

Instantly share code, notes, and snippets.

View GuyPaddock's full-sized avatar

Guy Elsmore-Paddock GuyPaddock

View GitHub Profile
@GuyPaddock
GuyPaddock / gist:8d576858dea79d6bd27b
Created April 7, 2015 21:55
Additional fixes for the Toolbar in the Progressive premium theme for Drupal 7.
.toolbar.fixed-header.hidden-top .header {
margin-top: 1em;
}
.toolbar-drawer.fixed-header.hidden-top .header {
margin-top: 3em;
}
@GuyPaddock
GuyPaddock / opendj-server-legacy-pom.xml
Last active December 4, 2016 09:34
Modified OpenDJ Legacy Maven Build to include (Q)uick profile
<?xml version="1.0" encoding="UTF-8"?>
<!--
! CDDL HEADER START
!
! The contents of this file are subject to the terms of the
! Common Development and Distribution License, Version 1.0 only
! (the "License"). You may not use this file except in compliance
! with the License.
!
! You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
@GuyPaddock
GuyPaddock / deployAM13.sh
Created April 15, 2017 19:00
Scripts to package, install locally, and publish ForgeRock projects to the Rosie Artifactory
#!/bin/bash
#Run buildDJ3.sh script first in the same folder from: https://gist.github.com/aldaris/fe234d76f3940c42ae9bb5aa69b8e98e
function build() {
mvn clean deploy
if [ $? -ne 0 ] ; then
exit 1;
fi
}
@GuyPaddock
GuyPaddock / java_authbind.sh
Last active April 18, 2017 17:28 — forked from sukharevd/wildfly-install.sh
Script to install JBoss Wildfly 10.x as service in Linux
#!/bin/bash
/usr/bin/authbind --deep /usr/bin/java "$@"
@GuyPaddock
GuyPaddock / opendj.log
Created July 25, 2017 20:46
Debian dpkg behavior for all cases
# Deps available; regular install, remove, and purge
dpkg -i opendj-deb-standard-repack.deb
Selecting previously unselected package opendj.
(Reading database ... 128058 files and directories currently installed.)
Unpacking opendj (from opendj-deb-standard-repack.deb) ...
/var/lib/dpkg/tmp.ci/preinst Arguments: install
Setting up opendj (3.0.0) ...
/var/lib/dpkg/info/opendj.postinst Arguments: configure
Processing triggers for ureadahead ...
@GuyPaddock
GuyPaddock / simple_table.rb
Last active November 22, 2017 05:16
Enhanced Simple Table for ActiveAdmin + Arbre
module ActiveAdmin
module Views
##
# Exposes Arbre's table support as a simple control for use in ActiveAdmin.
#
# Example usage:
# ```
# simple_table [ [ "User count", User.count ],
# [ "Item count", Item.count ],
# [ "Total Wishes", Wish.count ],
@GuyPaddock
GuyPaddock / verify_ssl_cert.rb
Created March 8, 2018 22:52
Verifying SSL certificates with Ruby and OpenSSL
# This will only run in `irb -ropenssl`
require "socket"
require "openssl"
host = "comodo.com"
port = 443
cert_store = OpenSSL::X509::Store.new
cert_store.set_default_paths
@GuyPaddock
GuyPaddock / idm-5.5--01--run-as-root.sql
Last active June 13, 2018 19:55
Wren:IDM 5.5 SQL Install Script for Postgres SQL
-- Run this script as the Postgres ROOT user
--
-- Replace the following variables before you do:
-- PASSWORD_YOU_WANT - Should be the password you want to use for the
-- Wren:IDM user. DO NOT USE "openidm" as a
-- password.
-- ROOT_USER_ACCOUNT_NAME - Should be the name of the root account you are
-- logged-in as currently.
--
@GuyPaddock
GuyPaddock / have_validation_errors.rb
Created February 13, 2018 04:07
An RSpec matcher for doing precise checks on active model validations errors.
##
# An RSpec matcher for checking Rails validation errors on an object.
#
# Usage:
# # Expect exactly three validation errors:
# # - field1 must not be empty
# # - field1 must be a number
# # - field2 must be greater than zero
# expect(x).to have_validation_errors
# .related_to(:field1)
@GuyPaddock
GuyPaddock / TestIterators.java
Created October 12, 2018 15:21
Demo of how sequential iterators behave with parallel streams in Java 8
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
public class TestIterators {
public static void main(String[] args) {
List<String> strings =