Skip to content

Instantly share code, notes, and snippets.

View AmShaegar13's full-sized avatar

Finn Glöe AmShaegar13

  • Medlinq Softwaresysteme GmbH
  • Hamburg
  • 12:21 (UTC +02:00)
View GitHub Profile
@AmShaegar13
AmShaegar13 / store.js
Created May 17, 2022 12:40
Pinia plain JavaScript inheritance
function baseCounterStore(options) {
const baseState = {
counter: 0
}
const newState = options.state
options.state = () => {
return {
...baseState,
...newState()
@AmShaegar13
AmShaegar13 / bumpme
Last active April 30, 2018 11:15
Concourse demo file
Mon Apr 30 11:15:37 UTC 2018
@AmShaegar13
AmShaegar13 / outdated_files_query.js
Last active April 17, 2024 15:34
Delete outdated files from Rocket.Chat
/**
* 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;
@AmShaegar13
AmShaegar13 / test_case.rb
Last active August 29, 2015 14:21
Count results with custom `from` breaks
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