Skip to content

Instantly share code, notes, and snippets.

View jasoet's full-sized avatar
🎯
Focusing

Deny Prasetyo jasoet

🎯
Focusing
View GitHub Profile
@jasoet
jasoet / jsonpath.md
Created March 9, 2018 06:49
Json Path usage
title
JSONPath Support

JSONPath template is composed of JSONPath expressions enclosed by {}. And we add three functions in addition to the original JSONPath syntax:

  1. The $ operator is optional since the expression always starts from the root object by default.
  2. We can use "" to quote text inside JSONPath expressions.
  3. We can use range operator to iterate lists.
@jasoet
jasoet / ktorreq.kt
Last active October 13, 2018 15:18
Ktor Request
fun buildRequest(
userId: String,
pemReader: Reader
): HttpRequestBuilder.() -> Unit {
val chefServerHost = "https://chef-server.vpc"
val organizationPath = "/organizations/someorg"
return {
val httpMethod = method
val path = "$organizationPath/${url.encodedPath}"
@jasoet
jasoet / generate_docker_cert.sh
Created November 10, 2018 11:04 — forked from bradrydzewski/generate_docker_cert.sh
Generate trusted CA certificates for running Docker with HTTPS
#!/bin/bash
#
# Generates client and server certificates used to enable HTTPS
# remote authentication to a Docker daemon.
#
# See http://docs.docker.com/articles/https/
#
# To start the Docker Daemon:
#
# sudo docker -d \
@jasoet
jasoet / Makefiles.md
Created July 8, 2019 06:48 — forked from evertrol/Makefiles.md
Makefile cheat sheet

Makefile cheat sheet

Mostly geared towards GNU make

I've used ->| to indicate a tab character, as it's clearer to read than

  • Set a target, its dependencies and the commands to execute in order
target: [dependencies]
->| 
package main
import (
"bufio"
"bytes"
"fmt"
"io"
"k8s.io/client-go/kubernetes/scheme"
"os"
"os/user"
package status
import (
"experiment/pkg/k8s"
"experiment/pkg/util"
"fmt"
v1 "k8s.io/api/core/v1"
metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"time"
package job
import (
"fmt"
"github.com/go-co-op/gocron"
"reflect"
"strings"
"sync"
"time"
)