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
<!-- src/components/shared/Progress.vue --> | |
<template> | |
<div | |
class="progress" | |
:style="{ | |
'width': percent+'%', | |
'height': show ? height : '0px', | |
'background-color': canSuccess? color : failedColor, | |
'opacity': show ? 1 : 0 |
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
defmodule Lists do | |
def len([]), do: 0 | |
def len([_h|t]), do: 1 + len(t) | |
def sum([]), do: 0 | |
def sum([h|t]), do: h + sum(t) | |
def double([]), do: [] | |
def double([h|t]), do: [ 2*h | double(t) ] |
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
{"lastUpload":"2022-01-04T16:33:17.221Z","extensionVersion":"v3.4.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
def update_sign | |
sheet = Sheet.find(params[:id]) | |
encoded_image = params[:sign].split(",")[1] | |
decoded_image = Base64.decode64(encoded_image) | |
filename = "firma-#{sheet.id}.svg" | |
File.open("#{Rails.root}/storage/#{filename}", "wb") { |f| f.write(decoded_image) } | |
sheet.image.attach(io: File.open("#{Rails.root}/storage/#{filename}"), filename: filename) | |
FileUtils.rm("#{Rails.root}/storage/#{filename}") | |
render json: rails_blob_path(sheet.image, disposition: "inline") | |
end |