const R = require('ramda');
const users = [
{ ses: { sesCreds: 1 }, senders: [{ sender: 11 }, { sender: 12 }, { sender: 13 }] },
{ ses: { sesCreds: 2 }, senders: [{ sender: 21 }, { sender: 22 }, { sender: 23 }] },
{ ses: { sesCreds: 3 }, senders: [{ sender: 31 }, { sender: 32 }, { sender: 33 }] }
];
const notificationTypes = ['Bounce', 'Complaint'];
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
| # ruby --version | |
| # ruby 2.6.3p62 | |
| require 'benchmark' | |
| def without_splat(a, b, c); end | |
| def with_splat(*a); end |
const { forEach, fromIter, map, filter, pipe, interval, take, fromPromise, flatten } = require('callbag-basics');
const request = require('request-promise');
const Promise = require('bluebird');
const events = [
{ type: 'event', value: 1 },
{ type: 'event', value: 2 },
{ type: 'event', value: 3 },
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
| // This is meant to be executed periodically, adapt it depending on you sell pace | |
| // or create reports for previous weeks instead of using doing it in realtime. | |
| var moment = Moment.load(); | |
| var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
| var startOfLastWeek = moment.utc().startOf('week').add(1, 'd'); | |
| var endOfLastWeek = moment.utc().endOf('week').add(1, 'd'); | |
| Logger.log('Week starts: ' + startOfLastWeek.toString()); | |
| Logger.log('Week ends: ' + endOfLastWeek.toString()); |
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 Email::Validate | |
| def self.call(email) | |
| new(email, RFC::CheckSyntaxt, SMTP::CheckUserExistance).call | |
| end | |
| attr_reader :email, :rfc_check_syntaxt, :smtp_check_user | |
| def initialize(email, rfc_check_syntaxt, smtp_check_user) | |
| @email = email | |
| @rfc_check_syntaxt = rfc_check_syntaxt |
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 Shape | |
| def initialize(color) | |
| @color = color | |
| end | |
| def repr | |
| raise 'Abstract method, to be implemented on subclasses' | |
| end | |
| def draw |
Below are the actual files we use in one of our latest production applications at Agora Games to achieve zero downtime deploys with unicorn. You've probably already read the GitHub blog post on Unicorn and would like to try zero downtime deploys for your application. I hope these files and notes help. I am happy to update these files or these notes if there are comments/questions. YMMV (of course).
Other application notes:
- Our application uses MongoDB, so we don't have database migrations to worry about as with MySQL or postgresql. That does not mean that we won't have to worry about issues with the database with indexes being built in MongoDB or what have you.
- We use capistrano for deployment.
Salient points for each file:
NewerOlder