This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" SWITCH BETWEEN TEST AND PRODUCTION CODE | |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
function! OpenTestAlternate() | |
let new_file = AlternateForCurrentFile() | |
exec ':e ' . new_file | |
endfunction | |
function! AlternateForCurrentFile() | |
let current_file = expand("%") | |
let current_path = expand("%:h") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rack/test' | |
describe SampleMiddleware do | |
include Rack::Test::Methods | |
let(:inner_app) do | |
lambda { |env| [200, {'Content-Type' => 'text/plain'}, ['All good!'] } | |
end | |
let(:app) { SampleMiddleware.new(inner_app) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# installs and configures a graphite server | |
# | |
# depends on two modules from: | |
# - https://github.com/uggedal/puppet-module-nginx | |
# - https://github.com/uggedal/puppet-module-python | |
# global path for exec | |
Exec { | |
path => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
curl -XPUT "http://localhost:9200/_template/rsyslog_per_index?pretty=true" -d ' | |
{ | |
"template" : "rsyslog*", | |
"settings" : { | |
"number_of_shards" : 4, | |
"index.cache.field.type" : "soft", | |
"index.refresh_interval" : "5s", | |
"index.store.compress.stored" : true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ERROR: knife encountered an unexpected error | |
This may be a bug in the 'cookbook upload' knife command or plugin | |
Please collect the output of this command with the `-VV` option before filing a bug report. | |
Exception: NameError: undefined local variable or method `cookbook' for #<Chef::Knife::CookbookUpload:0x007fb50ac8d4c8> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
renderTemplate = (template, data) -> | |
template | |
.replace(/{{example_page}}/g, data["example_page"]) | |
.replace(/{{page_type}}/g, data["page_type"]) | |
mockupHtmlTemplate = '<div> | |
<label>Example page:<input onchange="textChanged(this)" name="example_page" value="{{example_page}}"></label><br/> | |
<label>Page type:<input onchange="textChanged(this)" name="page_type" value="{{page_type}}"></label> | |
</div>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fog' | |
connection = Fog::Compute.new( | |
provider: 'AWS', | |
aws_access_key_id: 'AKIAIEXAMPLEEXAMPLE6', | |
aws_secret_access_key: 'example+example+example+example+example7', | |
region: 'us-east-1' | |
) | |
connection.servers.all.each do |server| | |
puts server.id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "https://rubygems.org" | |
gem 'chef', '>= 11.0' | |
gem 'librarian' | |
gem 'vagrant', '= 1.0.6' | |
gem 'vagrant-hostmaster' | |
gem 'foodcritic' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## using https://github.com/apsoto/monit/ cookbook | |
## this works | |
bind_cookbook_name = cookbook_name | |
monitrc 'redis' do | |
action :enable | |
reload :delayed | |
variables({ :pidfile => "/var/run/redis/6379/redis_6379.pid" }) | |
template_cookbook bind_cookbook_name | |
template_source 'redis_monit.conf.erb' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AJS.toInit(function () { | |
AJS.$("[name=run_dynamic_publisher_id]").select2({width: "400px"}); | |
$("[class^=atlassian-select2]").each(function (ei, ee) { | |
ee.className = ee.className.replace("atlassian-select2", "select2"); | |
}); | |
}) |