Skip to content

Instantly share code, notes, and snippets.

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDYTZfCvoPtus3vMMl0AS8a6K3OPZijMxiuiGD23ySUv14TIm+Azrzav+gH1BTDdnpK6/aQBzo5UEQwKCXxdpdV6s4OHEyLcCvUPm3fAe4Idy7iNtX+UmtumsAqMRovN+T8PAGqe0NOUC9Qq0+zDyH+qz0D44rPAIFs54EpCRq4hpvRHh5Oqy9nb6dYzW94HagDtPga2GeqqPdyhZD9gngsv0uOMWLhbF67S8No1oY6V3GaEelzZr2lLy/86k3kTbOuT1iWRJsKcjwuv0Ikwz3UeZcF1m6PrY3V6Qz9lh9CwrP464SlZ9GzqM4OKB1pPrCetUGKlcX2c3nUIV/x/iOP justin@allstaff
test_name "Installing Puppet and vcsrepo module" do
step 'install puppet' do
if @options[:provision]
# This will fail if puppet is already installed, ie --no-provision
if hosts.first.is_pe?
install_pe
else
install_puppet
end
end
@justinstoller
justinstoller / jenkins-slave.sh
Created July 18, 2014 19:57
basic init script
#!/bin/sh
#
# /etc/init.d/jenkins-slave
# init script for Jenkins Slave Swarm Client.
#
# chkconfig: 2345 90 60
# description: Jenkins Slave Swarm Client
#
RETVAL=0
require 'spec_helper_acceptance'
describe 'just to make the setup code run' do
it { true }
end
require 'spec_helper_acceptance'
describe 'a basic test' do
it 'does very little' do
puppet_run = apply_manifest("notify {'Hello Bar': }", :catch_failures => true)
expect(puppet_run.stdout).to include('Hello Bar')
end
end
legacy_opts = {
:default_action => 'gem_install',
:version => (ENV['PUPPET_VERSION'] || '3.8.1'),
}
aio_opts = {
:default_action => 'gem_install',
:version => (ENV['PUPPET_AGENT_VERSION'] || '1.1.0'),
}
@justinstoller
justinstoller / README.markdown
Created August 14, 2011 03:27 — forked from ariera/README.markdown
Nestable, sortable and dragable categories

Nestable, sortable and dragable categories:

In the project I'm working on we wanted to have a Category model which we wanted to be nestable. But we also liked the user to have a draggable interface to manage and rearrange the order of his categories. So we chose awesome_nested_set for the model and jQuery.nestedSortable for the UI.

It took me some time to arrange things to work properly so I wanted to share my work in case it helps anybody.

Before beginning

you might want to take a look at a demo app

  1. go to: http://awesomenestedsortable.heroku.com/groups/
  2. click in show of any group
@justinstoller
justinstoller / rspec-syntax-cheat-sheet.rb
Created August 14, 2011 03:28 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@justinstoller
justinstoller / sinatra_plugin.rb
Created February 23, 2012 19:20
jenkins_embedding_rack
root@ubuntu-precise:~/work/sinatra_plugin# cat models/sinatra_plugin.rb
require 'rubygems'
require 'sinatra/base'
require 'jenkins/rack'
class SomeSinatraApp < Sinatra::Base
get '/hi' do
'Help'
end
end
@justinstoller
justinstoller / config.erb
Created February 29, 2012 08:36
jenkins_triggers
root@ubuntu-precise:~/work/my_trigger# cat views/my_trigger/config.erb
<%
f = taglib('lib/form')
f.entry :title => 'MyTrigger', :field => 'my_trigger_text_box_entry',
:description => 'This is the form field for MyTrigger' do
f.textbox :title => 'MyTriggers TextBox', :field => 'my_trigger_text_box'
end
%>