This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function gfx_hud_object_add(name, tab) | |
print('gfx_hud_object_add("' .. name .. '", ' .. tostring(tab) .. ')') | |
end | |
local function thingy(path) | |
self = { | |
path = path | |
} | |
setmetatable(self, { | |
__index = function(self, k) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local native_expand_template = std.native("expand_template"); | |
{ | |
expand_template(template, env): [ | |
native_expand_template(template, std.toString(env)) | |
], | |
expand_sharded_template(template, env, all_shards): [ | |
native_expand_template(template, std.toString(env + { shard_name: shard_name })) | |
for shard_name in all_shards |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local expand_template(template, vars) = | |
std.native("expand_template")(template, std.toString(vars)); | |
{ | |
response: expand_template(||| | |
Hello {{ title }} {{ family_name }}, please take a seat. | |
|||, { | |
title: "Dr", | |
family_name: "Frankenstein", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
template: (importstr "template.yaml") % { | |
name: "rabbitmq", | |
image: "whatever", | |
cookie: "XXXX", | |
data_volume: std.toString({ name: "thing", foo: [1, 2, 3] }), | |
nodes: std.toString(['rabbit@rabbitmq-%s' % shard_name for shard_name in [1, 2, 3]]), | |
}, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local resources = import "resources.libsonnet"; | |
// "Top-level" function -- parameters can be overridden from the commandline. | |
// (Syntax is like Python) | |
function( | |
cookie="Dffds9342", | |
data_volume={ | |
emptyDir: { | |
medium: "", | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%.h.gch: %.h | |
@mkdir -p out | |
g++ -Wall -Wextra -pedantic -x c++-header -I. $< -o out/$@ | |
main: main.cpp header.h.gch | |
@mkdir -p out | |
g++ -Wall -Wextra -pedantic -Winvalid-pch -I out $< -o out/$@ | |
clean: | |
rm -rfv out *~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"encoding/json" | |
"fmt" | |
"github.com/Masterminds/sprig" | |
"github.com/cloudfoundry-incubator/candiedyaml" | |
"github.com/ghodss/yaml" | |
"io" |