Skip to content

Instantly share code, notes, and snippets.

@ehelms
ehelms / gist:5025156
Last active December 14, 2015 03:59
Alchemy Thoughts

Mission

A fast lane for bringing features to life.

  • For Developers: to allow developers to focus on features and functionality through re-usable, configurable components
  • For Users: provide consistent and comfortable UI interactions to spend more time outside of the app, than in

Goals

  • To provide stand-alone components for common UI interactions
@ehelms
ehelms / gist:5034678
Last active December 14, 2015 05:19
Alchemy Steps

Fedora 18 - Editing an Existing Component

  1. sudo yum install npm [[1]] [1]
  2. sudo npm install -g yo bower grunt-cli phantomjs
  3. git clone <component-repo-name>
  4. cd alchemy-<name>
  5. git remote add <remote-name> <new-component-git-repo>
  6. npm install
  7. bower install --dev
#!/bin/sh
for (( i = 0; i <= $1; i++ ))
do
r=$(printf "%.6d" $RANDOM)
original='{"name":"XXX","cp_type":"system","facts":{"cpu.cpu_socket(s)":2,"network.hostname":"XXX"}}'
d=${original//XXX/system_$i_$r}
curl -k -u admin:admin -X POST -H "Content-Type: application/json" -d $d http://localhost:3000/katello/api/environments/2/systems > /dev/null
done
$scope.$watch($location.search(), function()
$scope.$watch('$location.search()', function()
$scope.$watch('$location.search().item', function()
$scope.$watch(function() { $location.search(); }, function()
$scope.$on('$routeUpdate', function()
initializer "splice_reports.assets.precompile", :group => :all do |app|
app.config.assets.precompile << SpliceReports::Engine.root.join('app', 'assets', 'javascripts')
app.config.assets.precompile << SpliceReports::Engine.root.join('app', 'assets', 'stylesheets')
end
config.assets.precompile << Proc.new do |path|
if path =~ /\.(css|js)\z/
full_path = Rails.application.assets.resolve(path).to_path
app_assets_path = Rails.root.join('app', 'assets').to_path
if full_path.starts_with? app_assets_path || full_path.includes?('splice_reports')
puts "including asset: " + full_path
true
else
puts "excluding asset: " + full_path
false
### KATELLO USAGE ###
%div{ 'ng-controller' => 'SystemsController' }
%div{'ng-class' => '{"modal-mask": table.newPaneVisible}'}
%div.form.table-searchbar
%h1
= _("Systems")
%div.fl.search-input-container{ 'alch-search'=>'table' }
%div.form.table-toolbar
%div{ 'alch-selected'=>'table' }
{
subtotal: 10,
total: 100,
systems: []
}
vs.
{
subtotal: 10,
<div class="table-searchbar">
<h1>{{ "Systems" }}</h1>
<div class="fl form">
<input type="text"
class="input input-search"
placeholder="Search..."
ng-model="table.searchTerm"
on-enter="table.search(table.searchTerm)">
<span class="result-count">Showing {{ table.offset }} of {{ table.subtotal }} ({{ table.total }} Total)</span>
</div>
/home/ehelms/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/test/unit.rb:328:in `autorun': uninitialized class variable @@installed_at_exit in Test::Unit::Runner (NameError)
from /home/ehelms/.rvm/rubies/ruby-1.9.3-p385/lib/ruby/1.9.1/test/unit.rb:640:in `<top (required)>'
from /home/ehelms/workspace/dynflow/test/test_helper.rb:1:in `require'
from /home/ehelms/workspace/dynflow/test/test_helper.rb:1:in `<top (required)>'
from /home/ehelms/workspace/dynflow/test/action_test.rb:1:in `require'
from /home/ehelms/workspace/dynflow/test/action_test.rb:1:in `<top (required)>'
from /home/ehelms/.rvm/gems/ruby-1.9.3-p385@global/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:15:in `require'
from /home/ehelms/.rvm/gems/ruby-1.9.3-p385@global/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:15:in `block in <main>'
from /home/ehelms/.rvm/gems/ruby-1.9.3-p385@global/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:4:in `select'
from /home/ehelms/.rvm/gems/ruby-1.