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
{ | |
"title": "user-agent", | |
"rows": [ | |
{ | |
"title": "Options", | |
"height": "50px", | |
"editable": true, | |
"collapse": false, | |
"collapsable": true, | |
"panels": [ |
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 'net/http' | |
require 'json' | |
require 'time' | |
es_host = "127.0.0.1" | |
es_port = "9200" | |
host = Net::HTTP.new(es_host, es_port) | |
apps = %w(App1 App2) |
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
public RavenClient raven | |
{ | |
get | |
{ | |
var ravenKey = "raven_key"; | |
var raven = new RavenClient(ravenKey); | |
return raven; | |
} | |
} |
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
classes: | |
rsyslog::client: | |
port: 1234 | |
parameters: | |
server: my-rsyslog-server |
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 'ostruct' | |
namespace :bootstrap do | |
desc "Boostrap development machine" | |
task :setup do | |
Rake::Task['bootstrap:secrets'].invoke | |
end | |
task :secrets do |
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
def render(template, save_path, vars) | |
template_file = File.open("lib/templates/#{template}", 'r').read | |
erb = ERB.new(template_file) | |
results = erb.result(OpenStruct.new(vars).instance_eval { binding }) | |
File.open(save_path, 'w+') { |file| file.write(results) } | |
end |
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
# grep across all commits | |
git grep <pattern> $(git rev-list --all) | |
# find out which branch(es) contains said commit | |
git branch -r --contains <sha1> |
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
// compiled javascript file | |
(function() { | |
var appendToContainer, buildElement, buildElements, getAllPeople, getAllPets, getPeople, getPets, | |
__slice = [].slice; | |
$(document).ready(function() { | |
return getAllPeople().then(getAllPets).then(buildElements).then(appendToContainer); | |
}); |
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
# Ref http://spin.atomicobject.com/2012/10/30/activerecord-black-magic/ | |
class EmployeeFinder | |
def self.accessible_by(user) | |
Employee.joins(:companies) \ | |
.merge(Company.where(:id => user.company_ids)) \ | |
.uniq | |
end | |
end |
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
vim $(grep -lr --include=*.rb omc_data_service .) |