A simple way to add querying by email
# frozen_string_literal: true
module DomainQuery
extend ActiveSupport::Concern
class_methods do
def by_email(domain=nil)
A simple way to add querying by email
# frozen_string_literal: true
module DomainQuery
extend ActiveSupport::Concern
class_methods do
def by_email(domain=nil)
# simple_form sends params inside an array | |
# ["first@email.com,second@email.com"] | |
def email_cc_list=(list) | |
write_attribute(:email_cc_list, | |
Array.wrap(list).first.split(",").uniq.join(",") | |
) | |
end | |
# is it possible the array ever holds more than 1 value? |
require 'net/http' | |
require 'uri' | |
require 'json' | |
uri = URI.parse("https://sellercentral.amazon.com/fba/profitabilitycalculator/productmatches?searchKey=B000I1TJW6&language=en_US&profitcalcToken=taco") | |
request = Net::HTTP::Get.new(uri) | |
request["Authority"] = "sellercentral.amazon.com" | |
request["Upgrade-Insecure-Requests"] = "1" | |
request["User-Agent"] = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36" | |
request["Accept"] = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3" |
<mjml> | |
<mj-body background-color="#ccd3e0" font-size="13px"> | |
<mj-section background-color="#fff" padding-bottom="20px" padding-top="20px"> | |
<mj-column width="100%"> | |
<mj-image src="https://www.andersonassociates.net/img/favicons/anderson-logo-large.png" alt="" align="center" border="none" width="100px" padding-left="0px" padding-right="0px" padding-bottom="10px" padding-top="10px"></mj-image> | |
<mj-text align="center" color="#356cc7" font-size="13px" font-family="Helvetica" padding-left="25px" padding-right="25px" padding-bottom="28px" padding-top="28px"> | |
<span style="font-size: 28px">Anderson & Associates</span><br/> | |
<span style="font-size: 20px">Invoice [[InvoiceDate]]</span> | |
</mj-text> | |
</mj-column> |
# frozen_string_literal: true | |
module ActiveStorage | |
class Downloader #:nodoc: | |
def initialize(blob, tempdir: nil) | |
@blob = blob | |
@tempdir = tempdir | |
end | |
def download_blob_to_tempfile |
module Persistence | |
def self.included(klass) | |
klass.extend(ClassMethods) | |
end | |
module ClassMethods | |
def all | |
puts 'all' | |
end |
#!/bin/bash | |
# extract jpg from PDF | |
# based on a script edited by Purch | |
##################################### | |
if [ -z $1 ];then echo Give target directory; exit 0;fi | |
find "$1" -depth -name '*.pdf' | while read file ; do | |
directory=$(dirname "$file") | |
oldfilename=$(basename "$file") |
The open sources ones have mostly rotted away, and the others are paid.
<% content_for :head do %>
<%= stylesheet_link_tag('https://cdnjs.cloudflare.com/ajax/libs/Trumbowyg/2.9.4/ui/trumbowyg.css') %>
<% end %>
// for single item | |
convert -density 150 -antialias "input_file_name.pdf" -append -resize 1024x -quality 100 "output_file_name.png" | |
// for bulk | |
mogrify -format png -alpha off -density 150 -quality 100 -resize 1024 *.pdf |