Skip to content

Instantly share code, notes, and snippets.

@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')
});
@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
@rafaeltuelho
rafaeltuelho / openshift-cheatsheet.md
Last active October 7, 2024 05:41
My Openshift Cheatsheet

My Openshift Cheatsheet

Project Quotes, Limits and Templates

  • Cluster Quota
oc create clusterquota env-qa \
    --project-label-selector environment=qa \
    --hard pods=10,services=5
    
oc create clusterquota user-qa \