Skip to content

Instantly share code, notes, and snippets.

View emailrhoads's full-sized avatar

John Rhoads emailrhoads

View GitHub Profile
@emailrhoads
emailrhoads / help.md
Last active November 20, 2023 19:03
Local Setup Process

Run DB, ES and Memcache in docker. Set the ports to XXXX:XXXX in compose file Start it up with build env = local Should work for you -- might need to stop local MySQL from runnig (and ES and memcache)

# So what happens is Mac has a native mysql server running on port 3306
# and this has a fJ db, but there are no jobs in it
# disable this and start the mariaDB docker service to use a better DB
# is it running?
sudo lsof -i -P | grep LISTEN | grep 3306
# kill it forever
/usr/local/mysql/bin/mysqladmin -u root shutdown
@emailrhoads
emailrhoads / es_breakout.rb
Last active February 9, 2024 15:33
FJ Public
res_hash = {}
['A', 'B', 'C'].each do |variant|
build_terms = []
build_terms << { range: { expires: { gte: Time.zone.now } } }
build_terms << { term: { ab_test_variant_list: variant } }
build_query = {
bool: {
must: build_terms
}
@emailrhoads
emailrhoads / checkout.liquid
Last active September 16, 2022 16:13
youtube creator gifting
<!DOCTYPE html>
<html lang="{{ locale }}" dir="{{ direction }}" class="{{ checkout_html_classes }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, height=device-height, minimum-scale=1.0, user-scalable=0">
<meta name="referrer" content="origin">
<title>{{ page_title }}</title>
@emailrhoads
emailrhoads / cart.liquid
Last active September 16, 2022 16:11
Leckerlee Shopify
{{ '//code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css' | stylesheet_tag }}
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js" defer="defer"></script>
<div class="cart container">
<div class="inner">
{% if cart.item_count == 0 %}
<div class="cart__empty">
<p>{{ 'cart.general.empty' | t }}</p>
<a href="/collections/shop" class="button button--primary">{{ 'cart.general.back' | t }}</a>
</div>
@emailrhoads
emailrhoads / report.rb
Created June 7, 2022 19:53
Role permissions report
data = Netzke::Base.descendants.map do |component|
next unless component.respond_to?(:marty_permissions)
# ancestors includes self
component_permissions = {}
component.ancestors.each do |ancestor|
next unless ancestor.respond_to?(:marty_permissions)
ancestor.marty_permissions.each do |action, roles|
@emailrhoads
emailrhoads / role_permissions.md
Created June 7, 2022 19:52
#marty create role permissions

‎‎​

@emailrhoads
emailrhoads / push_to_imdb
Created May 9, 2022 17:17
[Push to IMDB manually] #luna
EXEC cm_inventory_management.dbo.spIMDB_BlotterLoad
@Debug = 0,
@EmailList = '[email protected];[email protected]',
@XMLParam = '
<poolList>
<pooldetails id="CN4856" agency="GNMA" portid="1" trnno="31334961" compid="1" isoverride="1" iscollapse="0">
<loans/>
<investors>
@emailrhoads
emailrhoads / debug_execs.rb
Created April 20, 2022 21:18
[Debug Execs] #gemini
@posting = Marty::Posting.last
client_id = 700106
@bulk_engine = Marty::ScriptSet.new.get_engine('BulkApi')
# from bulk spec
@p = {
'commitment_days' => 15,
'automated_underwriting_system_type' => 'DesktopUnderwriter',
'mortgage_type' => 'Conventional',
'amortization_type' => 'Fixed',
'loan_amortization_period_count' => 360,
@emailrhoads
emailrhoads / test_two_pubs.rb
Last active May 9, 2022 17:18
[tesitng vanna] #vanna
posting = 'JTR-20220128-1222'
rgen1 = Vanna::RatesheetGenerator.new(
posting_name: posting,
posting_datetime: Time.zone.now,
division_name: 'Broker',
user: nil
)
rgen2 = Vanna::RatesheetGenerator.new(