Skip to content

Instantly share code, notes, and snippets.

View VineetReynolds's full-sized avatar
🚀

Vineet Reynolds VineetReynolds

🚀
View GitHub Profile
@VineetReynolds
VineetReynolds / DbUnit Notes.md
Created October 13, 2012 18:44
DbUnit Notes

Notes on DbUnit behavior and internals (v2.4.8)

Empty Strings and NULLs

  • Empty tables with no rows are expected to be present in the flat XML dataset as empty elements. For example, a table ADDRESS having no rows in the dataset should be listed as in the XML file. This should be done irrespective of whether the XML would be invalid when validated against the DTD generated for the dataset (ugh! beware of red squiggly lines in Eclipse).
  • Empty strings and NULL values in flat XML datasets:
  • DbUnit distinguishes between empty strings and NULLs.
  • For flat XML datasets, a null value is represented by omitting the column in the flat XML file. For example, if streetAddress and country are columns in the ADDRESS table, then a null streetAddress would be represented as ``. One could also use a replacement dataset that will convert placeholder values to Java null references.
@VineetReynolds
VineetReynolds / disable.sh
Created October 1, 2017 01:36
Disable bunch of #$!@ in Sierra (Version 2.1)
#!/bin/bash
# IMPORTANT: You will need to disable SIP aka Rootless in order to fully execute this script, you can reenable it after.
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
# Agents to disable
TODISABLE=('com.apple.security.keychainsyncingoveridsproxy' 'com.apple.personad' 'com.apple.passd' 'com.apple.screensharing.MessagesAgent' 'com.apple.CommCenter-osx' 'com.apple.Maps.mapspushd' 'com.apple.Maps.pushdaemon' 'com.apple.photoanalysisd' 'com.apple.telephonyutilities.callservicesd' 'com.apple.AirPlayUIAgent' 'com.apple.AirPortBaseStationAgent' 'com.apple.CalendarAgent' 'com.apple.DictationIM' 'com.apple.iCloudUserNotifications' 'com.apple.familycircled' 'com.apple.familycontrols.useragent' 'com.apple.familynotificationd' 'com.apple.gamed' 'com.apple.icloud.findmydeviced.findmydevi
failed to compile tested package feature:
WORK=/var/folders/b0/3v0rtks95fq_8p681jy91q540000gn/T/go-build081828163
# github.com/golang
./nonauthorized_test.go:75: cannot use "github.com/goadesign/goa/client".HTTPClientDoer(http.DefaultClient) (type "github.com/goadesign/goa/client".Doer) as type "github.com/almighty/almighty-core/vendor/github.com/goadesign/goa/client".Doer in argument to "github.com/almighty/almighty-core/client".New:
"github.com/goadesign/goa/client".Doer does not implement "github.com/almighty/almighty-core/vendor/github.com/goadesign/goa/client".Doer (wrong type for Do method)
have Do("golang.org/x/net/context".Context, *http.Request) (*http.Response, error)
want Do("github.com/almighty/almighty-core/vendor/golang.org/x/net/context".Context, *http.Request) (*http.Response, error)
./nonauthorized_test.go:170: cannot use "github.com/goadesign/goa/client".HTTPClientDoer(http.DefaultClient) (type "github.com/goadesign/goa/client".Doer) as type "github.com/almighty/almighty-core/vendor/git

Start Docker Machine

  • docker-machine start default

Start Kubernetes on Docker machine VM

  • kid up

Install Jenkins and Docker registry on kubernetes using Helm

@VineetReynolds
VineetReynolds / Textmate-Instructions.md
Last active April 27, 2016 01:58
Installing Asciidoc bundle in Textmate 2
package org.jboss.examples.bankplus.customer.services.translators;
public class AccountTranslator {
public org.jboss.examples.bankplus.customer.model.Account
translate(org.jboss.examples.bankplus.customer.services.adapters.Account container) {
org.jboss.examples.bankplus.customer.model.Account account = null;
if(container != null) {
account = new org.jboss.examples.bankplus.customer.model.Account();
account.setAccountReference(container.getAccountId());
@Stateless
public class Accounts {
@PersistenceContext
private EntityManager em;
...
public Account getLiabilitiesAccount() {
TypedQuery<Account> findByNameQuery = em.createQuery("SELECT DISTINCT a FROM Account a "
+ "WHERE UPPER(a.name) = 'LIABILITIES'", Account.class);
Account liabiltiesAccount = findByNameQuery.getSingleResult();

Connect via jboss-cli.

Create the Postgres JBDC driver module:

[standalone@localhost:9999 /] module add --name=org.postgres --resources=/usr/share/java/postgresql-jdbc.jar --dependencies=javax.api,javax.transaction.api

Create the JBDC driver

html {
height: 100%;
}
body, table {
background-color: #FFFFFF;
color: #393939;
font: 13px/1.4em helvetica,arial,freesans,clean,sans-serif;
}
body {
float: left;
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.acme</groupId>
<artifactId>foo</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>war</packaging>