This file contains hidden or 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 'redis' | |
| module RedisMigrator | |
| def self.run | |
| from = "production:" | |
| to = "development:" | |
| start = Time.now | |
This file contains hidden or 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: analyze.rb REDIS_PORT | |
| #produces CSV with stats by key pattern | |
| #ex: [foo:bar:123, foo:bar:234] -> foo:bar:ID | |
| # development:hari:contest/log_entry#8a0b7edae8b965c9:log:in:contest | |
| # development:hari:notification#24d1d025654c71e7:components | |
| # development:rex:event#11570:traits | |
| require 'rubygems' |
This file contains hidden or 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
| var compareKeys = function(obj, obj2){ | |
| for(var key in obj){ | |
| var _obj = obj[key]; | |
| var _obj2 = obj2[key]; | |
| if(!_obj){ | |
| if(_obj2){ | |
| console.log("%s: %s => %s", | |
| key, _obj, _obj2); |
This file contains hidden or 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
| var Logger = require('logger-facade-nodejs'); | |
| var LoggerConsolePlugin = require('logger-facade-console-plugin-nodejs'); | |
| // this is the default config | |
| var config = { | |
| level: 'debug', | |
| timeFormat: 'YYYY-MM-DD HH:mm:ss', | |
| messageFormat: '%time | %logger::%level - %msg' | |
| }; |
This file contains hidden or 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
| var Logger = require('logger-facade-nodejs'); | |
| var LoggerAirbrakePlugin = require('logger-facade-airbrake-plugin'); | |
| console.log("Start sample of Async error Log..."); | |
| var config = { | |
| //api key, default (null) | |
| apiKey: "apikey", | |
| // host, default (null) | |
| host: "api.airbrake.io", |
This file contains hidden or 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
| class User | |
| attr_reader :born_on | |
| def age(today = Time.now.utc) | |
| return nil unless self.born_on.present? | |
| ((today.to_time - self.born_on.to_time) / 1.year).to_i | |
| end | |
| end |
This file contains hidden or 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
| mkdir -p /tmp/downloaded_files | |
| while IFS='' read -r line || [[ -n "$line" ]]; do | |
| #echo "Text read from file: $line" | |
| filename=$(echo $line | cut -d "," -f 1) | |
| url=$(echo $line | cut -d "," -f 2) | |
| echo "url: $url filename: $filename" | |
| curl $url -o "/tmp/downloaded_files/$filename" | |
| done < "$1" |
This file contains hidden or 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
| Sam Newman - Building Microservices | |
| http://shop.oreilly.com/product/0636920033158.do | |
| Sam Newman podcast with Beth Skurrie about: | |
| - microservices | |
| - vanila rails codebase issues on larger codebases | |
| - contract driven tests vs system integration tests | |
| - pact | |
| http://samnewman.io/blog/2015/12/16/magpie-talkshow-episode-8-beth-skurrie/ |
This file contains hidden or 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
| var Logger = require('logger-facade-nodejs'); | |
| var LoggerConsolePlugin = require('logger-facade-console-plugin-nodejs'); | |
| // this is the default config | |
| var config = { | |
| level: 'debug', | |
| timeFormat: 'YYYY-MM-DD HH:mm:ss', | |
| messageFormat: '%time | %logger::%level - %msg', | |
| json: true | |
| }; |
This file contains hidden or 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.js': | |
| 'Describe': | |
| 'prefix': 'desc' | |
| 'body': 'describe(\'$1\', function () {\n\tit(\'$2\', function () {\n\t\t$3\n\t});\n});' | |
| 'Test': | |
| 'prefix': 'it' | |
| 'body': 'it(\'$1\', function () {\n\t$2\n});' | |
| 'Before Each': | |
| 'prefix': 'be' | |
| 'body': 'beforeEach(function () {\n\t$1\n});' |
OlderNewer