Skip to content

Instantly share code, notes, and snippets.

View ezr-ondrej's full-sized avatar

Ondřej Ezr ezr-ondrej

View GitHub Profile
@ezr-ondrej
ezr-ondrej / run_dynflow.sh
Last active May 28, 2019 11:53
dynflow on ActiveJob example
# (re)create DB
DB=dynflow_example; dropdb -U postgres "$DB"; createdb -U postgres "$DB"
# install staff
sudo yum install redis
sudo systemctl enable --now redis
# set DB connection - expect dynflow user with dynflow password
export DB_CONN_STRING='postgres://dynflow:dynflow@/dynflow_example'
# start dynflow with web dashboard
bundle exec ruby ./examples/remote_executor.rb observer
# running dynflow dashboard on http://localhost:4567/dynflow
@ezr-ondrej
ezr-ondrej / vmware.rb
Created May 13, 2019 09:44
Disable update of VM params from foreman
# app/models/compute_resources/foreman/model/vmware.rb
# ...
def supports_update?
true
end
# ... change to
def supports_update?
false
end
# ...
@ezr-ondrej
ezr-ondrej / custom_component.js
Last active April 29, 2019 12:41
web_components.js
import React from 'react';
import { mountNode } from 'foremanReact/common/MountingService';
/**
* This tag can be used for mounting one react component from ComponentRegistry
* This way, we would decide to rewrite the mounter completely and we would make all components there to the custom tags.
*/
class ComponentInRegistryElement extends HTMLElement {
connectedCallback() {
const mountPoint = document.createElement('span');
module Fog
module Vsphere
class Compute
class Real
def create_vm(attributes = {})
# NOW
# stufff goes here....
# AFTER
CreateVmRequest.new(connection).call(attributes)
end