Skip to content

Instantly share code, notes, and snippets.


Daniel Schroeder udondan

Block or report user

Report or block udondan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Keybase proof

I hereby claim:

  • I am udondan on github.
  • I am udondan ( on keybase.
  • I have a public key ASByIy09-TGoshZYDjj9wd70hc68FgNlN4SQRfr3_FQecgo

To claim this, I am signing this object:

View IAM write actions.txt
View iTerm color highlight triggers.txt
Green BG with black FG
(?i)(success(ful(ly)?)?|passing|passed|pass(?!word|phrase|wd))|done|(?<![a-z])ok(?![a-z])|(?<![^\s:])(?:1|2)\d{2}(?![^\s:])(?! (k(ilo)?|M(ega)?|G(iga)?|T(era)?|P(eta)?)(i)?B(yte|it)?)
Orange BG
(?i)warnings|warning|warn|rejected|(?<![^\s:])(?:3)\d{2}(?![^\s:])(?! (k(ilo)?|M(ega)?|G(iga)?|T(era)?|P(eta)?)(i)?B(yte|it)?)
Red BG
(?i)error(s)?|fail(s|ed(?!=0)|ure(s(?!: \[]))?)?(?![a-z])|exception(s(?!: \[]))?(?![a-z])|abort(ed)?|decline(d)?|denied|fatal|TODO|(?<![^\s:])(?:4|5)\d{2}(?![^\s:])(?! (k(ilo)?|M(ega)?|G(iga)?|T(era)?|P(eta)?)(i)?B(yte|it)?)
Orange BG (for Terraform)
udondan / Example: golang gorm postgres uuid
Last active Aug 26, 2019
Example: golang gorm postgres uuid relation
View Example: golang gorm postgres uuid

Example: golang gorm postgres uuid relation

I was trying forever to get autoloading relationships working with postgres 9.4 and gorm and primary keys of type uuid.

Many tutorials and examples, even those on the official docs were just not workiong or missing important details.

The program in this gist creates the table structure and inserts a nested record. A parent and a child object is created by simply creating the child, which holds the relation to a parent. The child element then is queried by ID. The returned object holds the nested parent object.

Used package versions:

udondan / commandContext.go
Last active May 3, 2018
os/exec CommandContext example
View commandContext.go
package main
import (
func main() {
View consul-render
# Create a random file name for tmp files
RAND=$(cat /dev/urandom | env LC_CTYPE=C tr -dc 'a-zA-Z0-9' | head -c 32)
# Render content to tmp file and output content
echo -e "$CONTENT" > "$"
udondan /
Created Mar 16, 2015
Ansible filter plugin for testing if variables are iterable - available in Jinja2 but not in the version Ansible currently uses
from ansible import errors
from jinja2.filters import environmentfilter
class FilterModule(object):
def filters(self):
return {
'iterable': self.iterable
def iterable(*args):
udondan / ansible.cfg
Last active Aug 29, 2015
Cloned module fails
View ansible.cfg
# we don't want no paramiko!
transport = ssh
forks = 50
gathering = smart
host_key_checking = true
timeout = 30
scp_if_ssh = true
View MyModalWindowController.swift
import Cocoa
class MyModalWindowController: NSWindowController {
var mainW: NSWindow = NSWindow()
override init() {
udondan / include_vars_merged
Last active Mar 20, 2019
Ansible action plugin "include_vars_merged". Same as "include_vars" but merges hashes instead of overriding
View include_vars_merged


Current version of Ansible (1.7.1) does not merge hashes in the include_vars task even if told so via hash_behaviour = merge in your ansible.cfg.

This action plugin will merge hashes no matter how you have configured your hash_behaviour.

How to setup:

Save to library/plugins/action/

Save include_vars_merged to library/custom/include_vars_merged

You can’t perform that action at this time.