Skip to content

Instantly share code, notes, and snippets.

curl https://a.klaviyo.com/api/v1/email-template/dqQnNW/send \
-X POST \
-d api_key=API_KEY \
-d from_email=george.washington@example.com \
-d from_name='George Washington' \
-d subject='Your Weekly Summary' \
-d to='[{ "email" : "recipient@example.com", "name" : "Recipient Name" }]' \
-d context='{ "name" : "Recipient", "notifcation_count" : 8 }'
#/etc/rundeck/rundeck-config.properties
#loglevel.default is the default log level for jobs: ERROR,WARN,INFO,VERBOSE,DEBUG
loglevel.default=INFO
rdeck.base=/var/lib/rundeck
#rss.enabled if set to true enables RSS feeds that are public (non-authenticated)
rss.enabled=false
# change hostname here
grails.serverURL=https://rundeck.mysite.com
dataSource.dbCreate = update
# /etc/rundeck/framework.properties
# framework.properties -
#
# ----------------------------------------------------------------
# Rundeck server connection information
# ----------------------------------------------------------------
framework.server.name = rundeck.mysite.com
framework.server.hostname = rundeck.mysite.com
# /etc/nginx/conf.d/rundeck.conf
server {
listen 443 ssl;
server_name rundeck.mysite.com;
access_log /var/log/nginx/rundeck.mysite.com.access.log;
error_log /var/log/nginx/rundeck.mysite.com.error.log;
ssl_certificate /etc/ssl/certs/STAR_mysite_com.pem;
ssl_certificate_key /etc/ssl/certs/STAR_mysite_com.key;
@robskrob
robskrob / gist:cad08c7037419b0e26c58dcc6da01e73
Created March 29, 2019 19:30
There appears to be multiple app and redis containers
➜ dockerapp git:(branch-v0.4) 19-03-29 15:22 docker-compose up -d
Starting dockerapp_redis_1 ... done
Starting dockerapp_dockerapp_1 ... done
➜ dockerapp git:(branch-v0.4) 19-03-29 15:24 docker-compose logs
Attaching to dockerapp_dockerapp_1, dockerapp_redis_1
redis_1 | _._
redis_1 | _.-``__ ''-._
redis_1 | _.-`` `. `_. ''-._ Redis 3.2.0 (00000000/0) 64 bit
redis_1 | .-`` .-```. ```\/ _.,_ ''-._
redis_1 | ( ' , .-` | `, ) Running in standalone mode
Array
(
[0] => 2214980681841
[1] => 0
[2] => 2214986743921
[3] => 1
[4] => 2214986023025
[5] => 2
[6] => 2214981206129
[7] => 3
@robskrob
robskrob / prepared.sql
Created February 26, 2019 15:19
Prepared Statement
UPDATE wp_wps_collects
SET position=(
case
when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id = %d then %d when product_id =
@robskrob
robskrob / product_position_collectoin_update.sql
Created February 26, 2019 15:06
Product Position Collection Update
UPDATE wp_wps_collects
SET position=(
case
when product_id = '2214980681841' then '0' when product_id = '2214986743921' then '1' when product_id = '2214986023025' then '2' when product_id = '2214981206129' then '3' when product_id = '2214977798257' then '4' when product_id = '2214945751153' then '5' when product_id = '2214988873841' then '6' when product_id = '2214985924721' then '7' when product_id = '2215022002289' then '8' when product_id = '2214989168753' then '9' when product_id = '2214989135985' then '10' when product_id = '2214988284017' then '11' when product_id = '2214985629809' then '12' when product_id = '2214985564273' then '13' when product_id = '2214985138289' then '14' when product_id = '2214979371121' then '15' when product_id = '2214979174513' then '16' when product_id = '2214970720369' then '17' when product_id = '2214962004081' then '18' when product_id = '2214949093489' then '19' when product_id = '2214947946609' then '20' when product_id = '2215018463345' then '21' when product_id =
@robskrob
robskrob / base_module_pattern_explained_rails.rb
Created June 3, 2018 18:32
Base Module Pattern Explained In Rails
class CoreRailsBehavior
def say
# ActiveRecord, ActiveSupport, ActionDispatch etc....
puts "In Core Behavior of Rails Component"
end
end
module FeatureA
def say
puts "In Feature A"
@robskrob
robskrob / active_support_pattern.rb
Created June 2, 2018 15:28
Active Support -- Class level Methods from Module Pattern
module ClassLevelCallbacks
def self.included(class_including_this_module)
class_including_this_module.extend ClassMethods
end
module ClassMethods
def we_want_as_class_method
# this is invoked as a class method for the class that includes
# ClassLevelCallbacks
end