Skip to content

Instantly share code, notes, and snippets.

View richmolj's full-sized avatar

Lee Richmond richmolj

View GitHub Profile
require 'json'
Bundler.require(:default)
require 'sinatra/base'
require 'jsonapi/serializable'
require 'sequel'
require 'pry'
require 'pry-byebug'
DB = Sequel.sqlite(logger: Logger.new($stdout))
# Let's say you can only see employee salaries if you are a manager, an empployee in HR, or if you have a special privilege
# This employee also has "rank", their stack ranking, that should only be visible to managers
# This populates a grid in an internal admin screen
# The salary column is hidden if you shouldnt see it
#
# An employee also has reviews (managerial reviews) that follow the same logic.
# Click a row to expand and see reviews.
# Ember data model
#

Long story short, I’m getting my chicken soup on, it’s Sunday afternoon, and Gabe’s reading some Preacher in the Den, which is also the living room, the bathroom, and the foyer. I am interacting with pasta dough in what I think is a stern way, when I hear him say that he might like the soup better if it were, in fact, carrot cake. It hits us, hits us both, simultaneously, like a semi made out of lightning which is also a professional boxer. Carrot Cake Soup. You cube the carrot cake, some pieces have frosting and some don’t, and you put a handful of these chunks into a bowl full of milk. So let’s go do it. We’ll do it later this week, he says. But I know that’s the same as not doing it. Why not now, I say? I know a store where we can get all the stuff. You can just buy it, the way you can buy stuff in the household cleaners section and make a bomb big enough to kill God. The stuff is just lying around there and nobody’s doing anything with it. It’s not a crime to buy them separately, and what we do at home is

Cluster Creation

  • [RHST API ?] Need to improve the RHST cluster creation process. Currently requires approval, though everyone seems to agree this is unnnecessary. We need to improve this so users can create a cluster on our website and have that data sync'd with RHST.
  • [RHST API ?] Must be able to CRUD cluster tags. Currently tags are on the server, but it is a RHST and SoRd goal to move them to the cluster (additional tags can still be on servers, but optional). We need an overall plan on how to go from one world to the next, and what the API call(s) would be.

Security

  • PVFX over RBP
  • [PVF API ?] It looks like we can do this automatically for dev environemnts, but not prod.
class ActiveModel::Serializer
def initialize(object, options = {})
@object = object
@include_directive = options[:include]
end
def as_json
hash = serialize_attributes(@object)
self.relationships.each_pair do |name, relationship|
related_record = object.send(name)
import Ember from 'ember';
import DS from 'ember-data';
import moduleForAcceptance from '../../../tests/helpers/module-for-acceptance';
import NestedRelationsMixin from 'ember-data-extensions/mixins/nested-relations';
import ModelMixin from 'ember-data-extensions/mixins/model';
QUnit.dump.maxDepth = 999999999;
let serializer = null;
let store = null;
const fieldList = [
{ label: 'Foo Fields', fields: [{name: 'foo', selected: false}] },
{ label: 'Bar Fields', fields: [{name: 'bar', selected: true}] }
]
fields: Ember.computed('fieldList.@each', function() {
let fields = []
this.get('fieldList').forEach((config) => {
config.get('fields').forEach((field) => {
fields.push(field);
# Basic AR
class PeopleController < ApplicationController
jsonapi do
allow_filter :name, aliases: [:full_name] # ?filter[full_name] == ?filter[name]
allow_filter :title, if: :admin? # calls #admin? on the controller
includes whitelist: [:company, { pets: :breeds}]
end
begin
1/0
rescue => e
event = Raven.capture_exception(e)
sentry_link = "http://sentry.ny.cas.inf.bloomberg.com/sentry/chef-client/?query=#{event.id}"
end
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});