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
/// === DESCRIPTION === | |
/// This is a naive implementation of a registry for Actix Actors that | |
/// implement a SyncContext. Using it you can retreive an address for | |
/// any actor registered with it from any point in your program. | |
/// | |
/// === LICENSE === | |
/// Copyright 2019 Stanko K.R. <hey@stanko.io> | |
/// | |
/// Permission is hereby granted, free of charge, to any person | |
/// obtaining a copy of this software and associated documentation |
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
address-book; f2b9 | |
address-card; f2bb | |
angry; f556 | |
arrow-alt-circle-down; f358 | |
arrow-alt-circle-left; f359 | |
arrow-alt-circle-right; f35a | |
arrow-alt-circle-up; f35b | |
bell; f0f3 | |
bell-slash; f1f6 | |
bookmark; f02e |
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
= f.simple_fields_for :item do |ff| | |
.row.mt-4 | |
.col-12 | |
label Categories | |
.preview_images data-controller="has-many-fields-for" | |
.preview_images__container data-target="has-many-fields-for.container" | |
= ff.simple_fields_for :taggings do |ff| | |
= render 'category_tagging_form', f: ff | |
script type="text/html" data-target="has-many-fields-for.template" data-index-placeholder="new_tagging" | |
= ff.simple_fields_for :taggings, ff.object.taggings.build, child_index: 'new_tagging' do |ff| |
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
# Copyright 2018 Stanko K.R. <me@stanko.io> | |
# | |
# Permission is hereby granted, free of charge, to any | |
# person obtaining a copy of this software and associated | |
# documentation files (the "Software"), to deal in the | |
# Software without restriction, including without limitation | |
# the rights to use, copy, modify, merge, publish, distribute, | |
# sublicense, and/or sell copies of the Software, and to permit | |
# persons to whom the Software is furnished to do so, subject | |
# to the following conditions: |
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
array = [1,2,3,4,5] | |
array.map # => #<Enumerator: ...> | |
array.map { |i| i * 2 } # => [2, 4, 6, 8, 10] |
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
# This code is license under the MIT license | |
# Full text: https://opensource.org/licenses/MIT | |
# Author Stanko K.R. <hey@stanko.io> | |
# Usage: | |
# ```ruby | |
# user.avatar = S3UrlToShrineObjectConverter.call( | |
# arguments[:input][:avatar][:url], | |
# name: arguments[:input][:avatar][:filename] | |
# ) |
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
gallery = Gallery.find(arguemnts[:gallery_id]) | |
arguments[:images].map do |file| | |
# Image has a Shrine uploader attached to `file_data` | |
Image.create(file: file, gallery: gallery) | |
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
{ | |
galleryID: "some_gallery_id", | |
images: [ | |
#<ActionDispatch::Http::UploadedFile:0x000055fb90c6dbd0 @tempfile=#<Tempfile:/tmp/RackMultipart20180131-31-6zkb3i.txt>, @original_filename="b.txt", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"0\"; filename=\"b.txt\"\r\nContent-Type: text/plain\r\n">, | |
#<ActionDispatch::Http::UploadedFile:0x000055fb90c6da18 @tempfile=#<Tempfile:/tmp/RackMultipart20180131-31-13i0pio.txt>, @original_filename="c.txt", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"1\"; filename=\"c.txt\"\r\nContent-Type: text/plain\r\n"> | |
] | |
} |
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
mutation UploadGalleryImages { | |
uploadGalleryImages( | |
galleryID: "some_gallery_id" | |
images: [null, null] | |
) { | |
id | |
filename | |
url | |
} | |
} |
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
user.avatar_data_uri = arguments[:input][:avatar][:data] | |
user.save |
NewerOlder