Skip to content

Instantly share code, notes, and snippets.

---
- hosts: localhost
include: myvars.yml
pre_tasks:
- debug: var=num_servers_to_provision
roles:
- {role: provision}
---
- hosts: localhost
vars_files:
# Todo: Find a way of putting this in another file and including it. Otherwise we'll be repeating it all over the place.
- ["inventory/group_vars/{{ env_name | mandatory }}.yml", "inventory/group_vars/empty.yml"]
- ["inventory/group_vars/{{ env_name | mandatory }}-{{ app_name }}.yml", "inventory/group_vars/empty.yml"]
- ["inventory/group_vars/{{ env_name | mandatory }}-{{ app_name }}-{{ role_name }}.yml", "inventory/group_vars/empty.yml"]
pre_tasks:
- debug: var=num_servers_to_provision
roles:
---
- hosts: localhost
vars_files:
# Todo: Find a way of putting this in another file and including it. Otherwise we'll be repeating it all over the place.
- ["inventory/group_vars/{{ env_name | mandatory }}.yml", "inventory/group_vars/empty.yml"]
- ["inventory/group_vars/{{ env_name | mandatory }}-{{ app_name }}.yml", "inventory/group_vars/empty.yml"]
- ["inventory/group_vars/{{ env_name | mandatory }}-{{ app_name }}-{{ role_name }}.yml", "inventory/group_vars/empty.yml"]
pre_tasks:
- debug: var=num_servers_to_provision
roles:
---
- hosts: tag_Name_MyApp:&tag_Env_staging:&tag_Role_web
roles:
- common
- web
- ruby
- mongos_client
// Try to find a contact that is connected to a node
// with an email addrss of bob@google.com or jerk@hello.com
// Pick the first one (there should never be multiple contacts with the same emails)
// but just in case, pick the first found)
MATCH (e1:Email)-[:EMAIL]-(c1:Contact)
WHERE (e1.address IN ['bob@google.com','jerk@hello.com'])
WITH e1,c1
LIMIT 1
// Create or make user based on ID
MERGE (u:User {id: 3})
#!/usr/bin/ruby
puts "hello"
require 'tempfile'
puts ARGV[1]
filename,lines,prefix = ARGV
unless filename && lines
#!/usr/bin/ruby
puts "hello"
require 'tempfile'
puts ARGV[1]
filename,lines,prefix = ARGV
unless filename && lines
//= require foo.js
(function($, _, Backbone){
Backbone._ = _;
Backbone.$ = $;
})
//= require bar.js
($.noConflict(), _.noConflict(), Backbone.noConflict());
@bkimble
bkimble / param_spec.rb
Created December 16, 2012 04:49
Typhoeus URL testing
require 'spec_helper'
#Ethon param test
describe Ethon::Easy::Params do
before do
@dataset =
[
#basics
["http://a.com", {:foo => '1'}, "http://a.com?foo=1"],
["http://a.com", {:foo => 1}, "http://a.com?foo=1"],
@bkimble
bkimble / gist:1365005
Last active August 22, 2024 14:21
List local memcached keys using Ruby
#!/usr/bin/env ruby
# List all keys stored in memcache.
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place.
require 'net/telnet'
headings = %w(id expires bytes cache_key)
rows = []