Skip to content

Instantly share code, notes, and snippets.

View srfrnk's full-sized avatar
:octocat:
prancing about

Srfrnk srfrnk

:octocat:
prancing about
View GitHub Profile
@srfrnk
srfrnk / Yaml2Crdk8s.js
Created April 4, 2024 08:51
Convert YAML K8s manifest file into a JS CDK8S manifest
#!/usr/bin/env node
const fs=require('fs');
const YAML = require('yaml')
input=YAML.parseAllDocuments(fs.readFileSync('/dev/stdin').toString(),{}).map((item)=>item.toJS());
for (const obj of input) {
kind=obj.kind;
delete obj.kind;
delete obj.apiVersion;
api-info:
version: <ANY STRING>
title: <ANY STRING>
description: <ANY MARKDOWN TEXT>
docker run --rm -v /mybox/myfiles:/internal ghcr.io/srfrnk/crd-api-doc-gen:latest /internal/some/path /internal/another/path
name: Build
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
const core = require("@actions/core");
var moment = require('moment');
function action() {
try {
const time = new Date().toISOString();
core.setOutput("time", time);
const format = core.getInput('format', { required: false });
core.setOutput("formattedTime", moment().format(format));
name: "Current Time 2"
author: "Gerred Dillon <[email protected]>, Shahar Frank<[email protected]>"
description: "Get the current time with format"
branding:
icon: clock
color: blue
inputs:
format:
description: "Time format to use using [MomemtJS syntax](https://momentjs.com/)"
default: "<None>"
name: Build
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
docker-push:
docker tag ks:$(GIT_TAG) docker.pkg.github.com/$(REPOSITORY)/ks:$(GIT_TAG)
docker push docker.pkg.github.com/$(REPOSITORY)/ks:$(GIT_TAG)
@srfrnk
srfrnk / csv.ipynb
Last active October 6, 2019 06:51
csv.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
if v.EnvRef.Name != "" {
value := os.Getenv(v.EnvRef.Name)
return value, nil
}