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
{ | |
name: "awareness", | |
label: "Brand Awareness", | |
type: "binary", # question/measure type | |
dimensions: ["respondent", "brand"], | |
values: { | |
respondent: [1,1,3,4,...], | |
brand: [1,2,2,2,...], | |
value: [1,1,1,0,...] | |
} |
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
## Environment | |
``` | |
Bundler 1.14.3 | |
Rubygems 2.6.10 | |
Ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin15] | |
GEM_HOME /Users/brendon/.rvm/gems/ruby-2.3.3@insight-app | |
GEM_PATH /Users/brendon/.rvm/gems/ruby-2.3.3@insight-app:/Users/brendon/.rvm/gems/ruby-2.3.3@global | |
RVM 1.29.0 (master) | |
Git 2.11.0 |
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
define redirect_stdout | |
call rb_eval_string("$_old_stdout, $stdout = $stdout, File.open('/tmp/ruby-debug.' + Process.pid.to_s, 'a'); $stdout.sync = true") | |
end | |
define ruby_eval | |
call(rb_p(rb_eval_string_protect($arg0,(int*)0))) | |
end | |
redirect_stdout |
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
desc 'Pretty version on rails rake routes.' | |
black = "\033[1;30m" | |
red = "\033[1;31m" | |
yellow = "\033[1;33m" | |
blue = "\033[1;34m" | |
magenta = "\033[1;35m" | |
cyan = "\033[1;36m" | |
white = "\033[1;37m" | |
no_color = "\033[0m" |
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
<AdditionalInfo> | |
<Name>Ipsos_Test1012_South Africa_Beverages</Name> | |
<Uom>R</Uom> | |
<MarketValue>10000</MarketValue> | |
<BvcSourceType>BVC Self-Service</BvcSourceType> | |
</AdditionalInfo> |
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
sudo -s | |
cd /tmp | |
find . -name '*.png' -delete |
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 sort_key(obj) | |
if obj.is_a?(Array) | |
obj.map { |o| sort_key o } | |
elsif obj.respond_to?(:is_a_number?) && obj.is_a_number? | |
obj.to_f | |
elsif obj.respond_to?(:downcase) | |
obj.downcase | |
else | |
obj | |
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
#!/usr/bin/perl | |
#fetch Gravatars | |
use strict; | |
use warnings; | |
use LWP::Simple; | |
use Digest::MD5 qw(md5_hex); | |
my $size = 90; |
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/ruby | |
files = Dir["reports*"] | |
files.each do |f| | |
dir = File.join(`cat #{f}|grep DocumentRoot`.lines.first.split(/\s+/).last.split(/\//)[0..-2]) | |
rails_version = `cd #{dir}; rvm exec bundle list|grep ' rack'`.match(/\(([^)]+)\)/)[1] | |
deployed_version = `cd #{dir}; cat version` | |
deployed_branch = `cd #{dir}; cat config/environments/capistrano/#{f.to_s.gsub(/reports_/, '')}.rb|grep :branch` | |
puts "#{f}: #{rails_version}@#{deployed_version} - #{deployed_branch}" | |
end |