Skip to content

Instantly share code, notes, and snippets.

View bjartek's full-sized avatar
💭
No power in the verse can stop me

Bjarte S. Karlsen bjartek

💭
No power in the verse can stop me
  • Shiny && Find && Versus
  • Lillesand, Norway
  • X @0xBjartek
View GitHub Profile
import NonFungibleToken from 0xNONFUNGIBLETOKEN
pub contract TenantService: NonFungibleToken {
// basic data about the tenant
pub let version: UInt32
pub let name: String
pub let description: String
pub var closed: Bool
@nikoheikkila
nikoheikkila / README.md
Last active May 28, 2024 20:08
Fish Shell function for sourcing standard .env files

envsource

⚠️ NOTE (20.5.2023): I don't really use this function at all anymore since there are now tools such as Taskfile, which reads the .env file for me sparing me the need to pollute my session with environment variables.


I've been using Fish shell for years which is great and all, but one thing that has got me frustrated is using it with .env files.

When attempting to run source .env in a project, I usually encounter this problem:

@stettix
stettix / things-i-believe.md
Last active March 20, 2024 17:45
Things I believe

Things I believe

This is a collection of the things I believe about software development. I have worked for years building backend and data processing systems, so read the below within that context.

Agree? Disagree? Feel free to let me know at @JanStette. See also my blog at www.janvsmachine.net.

Fundamentals

Keep it simple, stupid. You ain't gonna need it.

@dcwangmit01
dcwangmit01 / main.go
Last active March 2, 2024 14:54
Self-templating with golang text/template and gomplate
/*
Demo program illustrating usage of gomplate as a library.
This program will accept an input file and run it through the templating
engine as both the values dictionary as well as the template file. It will
repeat the process until the templating result stops changing, and print
the result to STDOUT.
This program add the gomplate datasources and functions to the golang
text/template engine. This requires the input to be have the gomplate
@tuxfight3r
tuxfight3r / openshift_cli_tricks.MD
Last active March 30, 2023 18:02
openshift cli tricks - using go templates

openshift list all pods and thier specs (requests/limits)

oc get pod -o jsonpath='{range .items[*]}{"SPEC:  \n  LIMITS  : "}{.spec.containers[*].resources.limits}{"\n  REQUESTS: "}{.spec.containers[*].resources.requests}{"\n"}{end}'

openshift list all pods and thier specs with name (requests /limits)

oc get pod -o jsonpath='{range .items[*]}{"NAME:  "}{.metadata.name}{"\nSPEC:  \n  LIMITS  : "}{.spec.containers[*].resources.limits}{"\n  REQUESTS: "}{.spec.containers[*].resources.requests}{"\n\n"}{end}'
package api.resource;
import javax.ws.rs.*;
import net.hamnaberg.json.*;
@Path("/events")
@Produces("application/vnd.collection+json")
@Consumes("application/vnd.collection+json")
public class EventResource{