- accept and descend 'tags' throughout dashboard
- handle user-specific 'dashboards'
- include Rules Module
####DashboardComponent::Wrapper
#!/bin/bash | |
# Clone of Capture Screen Region on Mac OSX (map to similar Cmd-Ctrl-Shift-4) | |
# *** Requirements *** | |
# shutter - `apt-get install shutter` | |
# copyq - download from https://github.com/hluk/CopyQ/releases | |
shutter --select --no_session --exit_after_capture --output=/tmp/screenshot-surrent.png | |
copyq write image/png - < /tmp/screenshot-surrent.png && copyq select 0 | |
rm /tmp/screenshot-surrent.png |
#!/bin/bash | |
##################################################### | |
# Name: Bash CheatSheet for Mac OSX | |
# | |
# A little overlook of the Bash basics | |
# | |
# Usage: | |
# | |
# Author: J. Le Coupanec | |
# Date: 2014/11/04 |
# | |
Document.where(:wholesale_price_group.ne => nil, :total_prices.ne => {}).each do |doc| | |
wsl = doc.total_prices[doc.wholesale_price_group] | |
Document.collection.where({_id: doc.id}).update({ | |
"$set" => { :wholesale_total => wsl } | |
}) | |
end |
def assemble_ii(item) | |
match = item.class.to_s.match('Inventory([0-9]+)')[1] | |
if match == "05" | |
region = "-#{match}" | |
else | |
region = "" | |
end | |
@ii = { | |
key: item.upc, |
def nested_dup | |
dup_dash_hash = self.dup.as_document | |
children_hash.each do |key, child_object| | |
dup_dash_hash["#{key.to_s}_attributes"] = child_object.dup.as_document | |
end | |
new_dash = Dashboard::Component::Wrapper.new(dup_dash_hash) | |
new_dash.carousel.items.map {|it| it.image.reprocess! } | |
new_dash.content_ribbon.items.map {|it| it.image.reprocess! } |
Paperclip.interpolates :altered_image_filename do |attachment, style| | |
# The change is at the very end here | |
attachment.instance.original_filename.match(/([A-Za-z0-9]+_)?[A-Za-z0-9]+_[a-zA-Z0-9]+_[PSA](_[0-9]+)?/).to_s + ".png" | |
end | |
#^~~~~~~~~^ |
#!/bin/bash | |
set -f | |
echo 'Iterating through all Sidekiq screens' >&2 | |
for i in $( screen -ls sidekiq| grep -o [0-9]*.sidekiq\-[a-z]*); do | |
SCREEN_ID=$(echo $i | grep -oE "(^[0-9]+)") | |
CLIENT=$(echo $i | grep -oE "([a-z]+)$") | |
echo "starting screen: ${i}" |
prod_nums = Product.all.map(&:number).uniq | |
image_files = Dir.entries("data/products") | |
image_files.delete(".") | |
image_files.delete("..") | |
image_files.each do |imf| | |
unless prod_nums.include?(imf.split('_')[0]) | |
File.delete("data/products/#{imf}" |
//= require active_admin/base | |
var admin = { | |
init: function(){ | |
admin.set_admin_editable_events(); | |
}, | |
set_admin_editable_events: function(){ | |
$(".admin-editable").on("keypress", function(e){ | |
if ( e.keyCode==27 ) |