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
unless File.exist?('Gemfile') | |
File.write('Gemfile', <<-GEMFILE) | |
source 'https://rubygems.org' | |
gem 'rails', github: 'rails/rails' | |
gem 'arel', github: 'rails/arel' | |
gem 'sqlite3' | |
GEMFILE | |
system 'bundle' | |
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
/** | |
* MongoDB query to delete outdated files from Rocket.Chat. You can specify the number of DAYS | |
* before a file is considered outdated. Deleted files are removed from GridFS completely keeping | |
* only the message in chat. The message is modified to be a link that points to ALT_LINK instead | |
* of the file and '(deleted)' is appended to the title. | |
* | |
* Tested with MongoDB 3.4 | |
*/ | |
const DAYS = 60; |
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
Mon Apr 30 11:15:37 UTC 2018 |
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
function baseCounterStore(options) { | |
const baseState = { | |
counter: 0 | |
} | |
const newState = options.state | |
options.state = () => { | |
return { | |
...baseState, | |
...newState() |