Skip to content

Instantly share code, notes, and snippets.

View rjswenson's full-sized avatar

Robin S. Healey rjswenson

  • Internet Superhighway
  • USA
View GitHub Profile
@rjswenson
rjswenson / set_clean_general_color.rb
Created April 1, 2024 17:14
cycle through a product csv and modify general color based on general or specific color name.
#!/usr/bin/env ruby
require 'csv'
# file = File.open('products_global_2.csv')
# file = File.rename(file, 'products_global_2-rename.csv')
# csv = CSV.open('products_global_2.csv', 'rb')
general_colors = %w[grey gray purple pink silver gold brown burlywood khaki navy beige indigo lime
red blue green orange yellow black white maroon tan turquoise sienna steel]
@rjswenson
rjswenson / multi1.1.txt
Created November 29, 2019 18:27
Mods to string
Version: 1
Name: mult1.1 -UN
Mods:
- Id: Core
Name: Core
- Id: 1752864297
Name: Multiplayer
- Id: 1629973374
Name: Multiplayer Compatibility
- Id: 1507748539
@rjswenson
rjswenson / ModsConfig.xml
Created November 29, 2019 03:02
Rimworld
<?xml version="1.0" encoding="utf-8"?>
<ModsConfigData>
<version>1.0.2408 rev747</version>
<activeMods>
<li>Core</li>
<li>__LocalCopy_Mod_Manager_-18-10</li>
<li>__LocalCopy_Startup_impact_-20-10</li>
<li>__LocalCopy_HugsLib_-20-10</li>
<li>__LocalCopy_JecsTools_-20-10</li>
<li>__LocalCopy_Miscellaneous_CORE__-20-10</li>
@rjswenson
rjswenson / remove.rb
Created November 6, 2018 15:45
Majestic remove S/A images for some Headwear
arr = ["198J-AJZ", "196T-9GI", "196W-9GY", "197A-9HP", "197B-9HV", "197C-9IA", "197R-9IY", "197D-9IB", "197E-9ID", "197S-9IZ", "197T-9J1", "197F-9IE", "197H-9IH", "197Z-A6G", "197U-9J5", "197V-9J6", "198C-9KV", "198D-9KY", "198K-9KZ", "198E-9L8", "198H-9LM"]
arr.each do |str|
p str
Image.where(original_filename: /.*#{str}_.*(?!87).*[SA]_01.png/).each do |img|
img.delete
end
end
@rjswenson
rjswenson / stuff.md
Created April 13, 2018 16:30
To update a spice into demo env

In the base of my spice, I ran docker build -t quay.io/elasticsuite/spice:burton-develop . Then created a tmp directory within the spice and created a Dockerfile FROM quay.io/elasticsuite/skillet:develop COPY --from=quay.io/elasticsuite/spice:burton-develop /spice /skillet/lib/client within said directory I ran docker build -t quay.io/elasticsuite/skillet:burton-develop . once complete, I pushed up the image docker push quay.io/elasticsuite/skillet:burton-develop

@rjswenson
rjswenson / confirmer.html.erb
Last active June 5, 2017 20:24
email template for translations
Hello <%= @user.name %>,
<%= @custom_catalog.author.name %> has shared a catalog, <%= @custom_catalog.name %>, with you.
You can access this catalog from the dashboard under the "Custom Catalogs" section.
The catalog will be identified with a link icon to indicate its a shared catalog.
The shared catalog is read only. If you modify it, a new copy will be created for you
that is not linked to the shared catalog.
One of your assigned dealers, <%= @document.customer_name %> (<%= @document.author.name %>) has submitted a
@rjswenson
rjswenson / settings_template.md
Last active July 11, 2017 15:36
Settings Ticket template

Requirements for client settings.rb

  • client url (ex: spyn.spyder.com)
  • client platform name (ex: SPYN, Elastic)
  • Missing Images image
  • logo for pdfs
  • short client name (ex: fox)
  • long client name (ex: Fox Racing)
  • https /SSL ?
  • available on as data/info ?

Rsync is amazingly powerful

There are 100's of options for rsync

And I can't remember the options to save my life - and that man page, just goes on and on...

My cheat sheet is 99% of the important ones:

I'll add explainers and examples in a follow up.

@rjswenson
rjswenson / docker.sh
Last active June 23, 2017 14:54
Linux/Debian Dev setup with Docker and services (mongodb / redis / elasticsearch)
sudo apt-get install docker
mkdir -p /mongodb/data
docker run --name mongo -p 27017:27017 -d -v /mongodb:/data mongo:latest bash -c 'mongod --logpath /data/mongodb.log --logappend --dbpath /data/data --storageEngine=wiredTiger'
mkdir -p /redis
docker run --name redis -p 6379:6379 -d -v /redis:/data redis:3.0.7 bash -c 'redis-server --dir /data --appendonly yes'
mkdir /elastic
docker run --name elastic --user elasticsearch -p 9200:9200 -p 9300:9300 -d -v /elastic:/data elasticsearch:1.4.5 bash -c 'elasticsearch --cluster.name elastic_cluster --node.name elastic01 --path.data /data/elastic-data --path.logs /data/elastic-logs'
@rjswenson
rjswenson / screenshot-capture-selection.sh
Created May 31, 2016 18:31 — forked from justsml/screenshot-capture-selection.sh
Linux/Debian Clone of Mac OSX 'Capture Screen Region' feature (map to similar Cmd+Ctrl+Shift+4)
#!/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