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/bash | |
# From http://wiki.opscode.com/display/chef/Package+Installation+on+Debian+and+Ubuntu | |
# Run: wget http://gist.github.com/raw/568876/install_chef_client.sh && bash install_chef_client.sh | |
echo "Add the Opscode APT Repository" | |
echo 'deb http://apt.opscode.com/ lucid main' | sudo tee /etc/apt/sources.list.d/opscode.list | |
sudo apt-get update | |
echo "Install curl" | |
sudo apt-get install curl |
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
#!/usr/bin/env ruby | |
# Usage: ruby dbt-log-to-csv.rb PATH_TO_DBT_LOGS | |
Model = Struct.new(:schema, :table, :rows_str, :size_str, :duration_str) do | |
def rows | |
rows = rows_str.to_f | |
rows = case rows_str | |
when /\d$/ | |
rows |
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
# Postgresql fancy datatypes! | |
* array | |
* hstore (=~ hash) | |
* json | |
* jsonb | |
Philippe Creux - [@pcreux](http://twitter.com/pcreux) |
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
init_config: | |
# `datadog/prerun.sh` will inject instances below on boot | |
instances: |
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
results = [] | |
queue = Queue.new | |
mutex = Mutex.new | |
THREAD_COUNT = 3 | |
threads = Array.new(THREAD_COUNT) do | |
Thread.new do | |
while (value = queue.pop) |
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
# Strings: | |
["Hello", | |
"Hi! Hi! Hi! Hi! Hi! Hi! Hi! Hi! Hi! Hi! ", | |
"Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woooot! Woo |
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
#!/usr/bin/env ruby | |
# Run unit test for all added or changed app, lib and test files. | |
# Ex: | |
# * `rtt` will run tests for all files changed since the last commit | |
# * `rtt master` will run tests for all files different from master | |
if ARGV[0] | |
files = `git diff --name-only $(git merge-base HEAD #{ARGV[0]})..$(git rev-parse --abbrev-ref HEAD)`.split("\n") | |
else | |
files = `git status -s`.split("\n").map { |f| f.split(' ').last } |
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_relative './credentials' | |
class SonosClient | |
BASE_URL = 'https://api.ws.sonos.com/control/api/v1' | |
Error = Class.new(StandardError) | |
def get(path) | |
r = HTTP.auth("Bearer #{access_token}") | |
.get(BASE_URL + path) |
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
#!/usr/bin/env ruby | |
# | |
# Run `bundle outdated | format_bundle_outdated` | |
# to get a CSV file listing the columns below for all outdated gems. | |
COLUMNS = [ "name", "newest", "installed", "requested", "groups", "delta" ].join(",") | |
class Version < Struct.new(:major, :minor, :patch, :beta) | |
def self.build(string) | |
new(*string.split('.').map(&:to_i)) |