Skip to content

Instantly share code, notes, and snippets.

TO_TSVECTOR(ARRAY_TO_STRING(holder_names)) ||
@citrus
citrus / proxy_test.rb
Created August 30, 2016 23:37
Ruby proxy pattern
class ProxyTest
attr_accessor :scope
class ScopeProxy
def initialize(obj, scope)
@obj = obj
@scope = scope
end
@citrus
citrus / permalink_fix.rb
Created August 31, 2017 17:18
Jekyll permalink fix for pages without trailing slash
#!/bin/sh
if [ -z "$1" ]
then
echo "You must specify a namespace to flatten" 1>&2
exit 1
else
namespace=$1
fi
@citrus
citrus / -
Created January 17, 2018 18:33
id: A unique integer identifier for the event
=> :provider_event_id
title: The title of the event
=> :title
url: URL of the event on seatgeek.com – you should direct users here to search for tickets
=> :affiliate_url
datetime_local: Date/time of the event in the local timezone of the venue – you will generally want to display this to users
@citrus
citrus / QuotePDFGenerator.apex
Last active June 12, 2022 06:02
Generate Quote PDF via Salesforce REST API
global class QuotePDFGenerator {
@future(callout=true)
public static void AttachPDFToQuote(String Id) {
try {
CreateQuoteDocumentFromPDF(Id);
} catch(exception ex) {
System.debug('Error: ' + ex);
}
}
Jul 27 16:41:49 my-app app/web.1: 2018-07-27 23:41:49 +0000: Rack app error handling request { GET /assets/my-asset.gif }
Jul 27 16:41:49 my-app app/web.1: #<NotImplementedError: NotImplementedError>
Jul 27 16:41:49 my-app app/web.1: /app/vendor/bundle/ruby/2.2.0/gems/rack-cache-1.8.0/lib/rack/cache/meta_store.rb:179:in `purge'
Jul 27 16:41:49 my-app app/web.1: /app/vendor/bundle/ruby/2.2.0/gems/rack-cache-1.8.0/lib/rack/cache/meta_store.rb:46:in `lookup'
Jul 27 16:41:49 my-app app/web.1: /app/vendor/bundle/ruby/2.2.0/gems/rack-cache-1.8.0/lib/rack/cache/context.rb:173:in `lookup'
Jul 27 16:41:49 my-app app/web.1: /app/vendor/bundle/ruby/2.2.0/gems/rack-cache-1.8.0/lib/rack/cache/context.rb:66:in `call!'
Jul 27 16:41:49 my-app app/web.1: /app/vendor/bundle/ruby/2.2.0/gems/rack-cache-1.8.0/lib/rack/cache/context.rb:51:in `call'
Jul 27 16:41:49 my-app app/web.1: /app/vendor/bundle/ruby/2.2.0/gems/newrelic_rpm-4.7.1.340/lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
Jul 27 16:41:4
@citrus
citrus / modal.css
Last active December 18, 2019 23:45
Simple Modal
.modal {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
z-index: 9999;
@citrus
citrus / clear-sidekiq-jobs.rb
Last active February 27, 2020 00:26 — forked from wbotelhos/clear-sidekiq-jobs.sh
Clear Sidekiq Jobs
require 'sidekiq/api'
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear
@citrus
citrus / run.txt
Created July 29, 2020 18:13
Transaction rollback failing
TransactionTest
test:Transaction should properly save record. PASS (0.07s)
Validation failed: Url can't be blank
test:Transaction should rollback record. FAIL (0.03s)
Expected: false
Actual: true
minitest (5.14.1) lib/minitest/assertions.rb:183:in `assert'
minitest (5.14.1) lib/minitest/assertions.rb:218:in `assert_equal'
test/test_helper.rb:129:in `assert_equal'
test/transaction_test.rb:25:in `block in <class:TransactionTest>'