Skip to content

Instantly share code, notes, and snippets.

/**
* RETURN INTERFACE
*/
type Parser interface {
Unmarshal(p []byte, v interface{}) error
}
func GetParser(fileName string) Parser {
suffix := filepath.Ext(fileName)
package kubewrap
# This is a proof of concept to allow us to use the same policies for both k8s manifests
# and admission controllers.
# This may be a good open source candidate if there are no other alternatives.
default is_admission_review = false
is_admission_review {
input.kind == "AdmissionReview"
resource "template_dir" "config" {
source_dir = "${path.cwd}/input"
destination_dir = "${path.cwd}/output"
}
data "null_data_source" "wait_for_config" {
inputs = {
destination_dir = "${template_dir.config.destination_dir}"
}
}
@jpreese
jpreese / CLA.md
Created February 11, 2019 16:54 — forked from pjcozzi/CLA.md
CLA for MIT license

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I have the right to submit it under the MIT license; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the MIT license; or

Do you promise not to do bad things?

package main
import (
"time"
)
var shutdown chan bool
func main() {
shutdown = make(chan bool)
$fakeObject | Add-Member -MemberType NoteProperty -Name SomeProperty -Value 1
$anotherFakeObject = New-Object -TypeName psobject
$anotherFakeObject | Add-Member -MemberType NoteProperty -Name SomeProperty -Value 2
$numbers = @()
$numbers += $fakeObject
$numbers += $anotherFakeObject
package main
// Square immediately returns the result
func Square(number int) uint64 {
return 1 << uint64(number-1)
}
// SquareVariable first puts it into a variable
func SquareVariable(number int) uint64 {
result := 1 << uint64(number-1)
function RunIt() {
Write-Output "1"
Write-Output "2"
$var = 42
Write-Output "3"
return $var
}
package main
import (
"fmt"
"reflect"
)
func main() {
teststring := "ab世"
runes := []rune(teststring)