Skip to content

Instantly share code, notes, and snippets.

@rafaeltuelho
rafaeltuelho / openshift-cheatsheet.md
Last active July 29, 2025 20:56
My Openshift Cheatsheet

My Openshift Cheatsheet

List all non openshift/kube namespaces

requires jq CLI

oc get namespaces -o json | jq '[.items[] | select((.metadata.name | startswith("openshift") | not) and (.metadata.name | startswith("kube-") | not) and .metadata.name != "default" and (true)) | .metadata.name ]'

Project Quotes, Limits and Templates

@stevenharman
stevenharman / defaults.rb
Last active July 7, 2021 14:36
A subtle difference between Ruby's Hash.fetch(:key, :default) vs. (Hash[:key] || :default)
h = {
'a' => :a_value,
'b' => nil,
'c' => false
}
h.fetch('a', :default_value) #=> :a_value
h.fetch('b', :default_value) #=> nil
h.fetch('c', :default_value) #=> false
h.fetch('d', :default_value) #=> :default_value
@crofty
crofty / observer example.js
Created February 8, 2012 12:12
Example of observers in Ember
App = Ember.Application.create()
Person = Ember.Object.extend({
fullName: Ember.computed(function() {
var firstName = this.get('firstName');
var lastName = this.get('lastName');
return firstName + ' ' + lastName;
}).property('firstName', 'lastName')
});