Skip to content

Instantly share code, notes, and snippets.

View strootman's full-sized avatar
🤘

Jonathan D Strootman strootman

🤘
View GitHub Profile
@strootman
strootman / dump_all_vars.yaml
Created November 24, 2015 19:27
A way to dump all the vars for a host. Must be used with `--limit`, otherwise, last host wins.
---
- name: Dump all vars
hosts: all
tasks:
- name: Dump all vars
template: src=scripts/dump_vars.j2 dest=/tmp/ansible.all
@strootman
strootman / groups_for_hosts.txt.j2
Created November 24, 2015 19:31
A means of determining which inventory groups are associated with a given host
{{inventory_hostname}}
========================
{% for group in group_names %}
{{ group }}
{% endfor %}
---
@strootman
strootman / gist:4997708
Created February 20, 2013 18:18
Example method to add to DEWindowManager
public List<IPlantWindowInterface> getIplantWindows() {
List<IPlantWindowInterface> windows = Lists.newArrayList();
for(Widget w : super.getWindows()){
if(w instanceof IPlantWindowInterface){
windows.add((IPlantWindowInterface)w);
}
}
return windows;
}
@strootman
strootman / .classpath
Created February 28, 2013 21:57
Project classpath file.
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="war/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="war/WEB-INF/classes" path="src/main/resources">
<attributes>
@strootman
strootman / gist:5274001
Last active December 15, 2015 14:19
Starts at "testBooleanToSplittableConversion"
public void testBooleanToSplittableConversion(){
testNullCheck(convertBooleanWithCreate(Boolean.FALSE)); // WILL NOT "do stuff"
testNullCheck(convertBooleanWithSplit(Boolean.FALSE)); // WILL "do stuff"
testNullCheck(convertBooleanWithCreate(Boolean.TRUE)); // WILL "do stuff"
testNullCheck(convertBooleanWithSplit(Boolean.TRUE)); // WILL "do stuff"
}
public void testNullCheck(Splittable testval){
if(testval != null){
Compiling module com.sencha.gxt.test.TestRunner
---------------------------
JAVA INITIAL:
---------------------------
public void display(Splittable result){
Window.alert("boolean value? " + result.asBoolean() + "\n" + "is null? " + (result == null));
}
---------------------------
FinalizeVisitor:
---------------------------
@strootman
strootman / journal.go
Created March 3, 2016 02:11 — forked from stuart-warren/journal.go
Golang read from systemd journal
package journal
// #cgo pkg-config: --cflags --libs libsystemd-journal
// #include <systemd/sd-journal.h>
import (
"C"
)
func New() (j *C.struct_sd_journal) {
j = new(C.struct_sd_journal)
@strootman
strootman / pr.md
Created March 30, 2016 17:19 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@strootman
strootman / default-w-var-sub.yml
Created July 22, 2016 21:37
Example of using the `default()` jinja filter with a variable
# 1.
# $ ansible-playbook default-w-var-sub.yml
#
# PLAY [Test default variable using substitution] ********************************
#
@strootman
strootman / elasticsearch.md
Created April 10, 2017 20:44 — forked from nicolashery/elasticsearch.md
Elasticsearch: updating the mappings and settings of an existing index

Elasticsearch: updating the mappings and settings of an existing index

Note: This was written using elasticsearch 0.9.

Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:

$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
  "_id": 1,