Skip to content

Instantly share code, notes, and snippets.

View joshuacronemeyer's full-sized avatar
🕶️
Plotting

Josh joshuacronemeyer

🕶️
Plotting
  • TruCentive
  • Berkeley
View GitHub Profile
@joshuacronemeyer
joshuacronemeyer / check.sh
Created May 20, 2020 16:57
Check TLS certificate expiration date with SNI enabled
openssl s_client -showcerts -connect www.caboenvivo.com:443 -servername caboenvivo.com 2>/dev/null | openssl x509 -noout -dates
@joshuacronemeyer
joshuacronemeyer / cancel_by_tour.rb
Last active May 6, 2020 20:57
cancel all orders for a tour with verbose confirmation for each event.
def cancel!(tour_id)
events = Tour.find(tour_id).events
events.each do |e|
orders_to_cancel = Purchase::Order.where(event_id: e.id).where(order_status: ["accepted","completed"])
if orders_to_cancel.length == 0
p "Skipping event with 0 orders to cancel"
next
end
p "Please confirm you would like to cancel #{orders_to_cancel.count} orders for event #{e.id} by typing 'CONFIRM'"
input = gets
@joshuacronemeyer
joshuacronemeyer / ReserveTickets.scala
Created September 17, 2019 16:08
Gatling test i'm having trouble running on Flood
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._
import java.util.Date._
import java.text.SimpleDateFormat._
// Mandatory, you must import Flood libraries
import flood._
@joshuacronemeyer
joshuacronemeyer / seatmap_munger.rb
Created October 19, 2017 17:01
munging SVG seatmaps
require 'nokogiri'
class ProcessSvgVenueMap
def initialize(file)
@file = file
@doc=Nokogiri::XML.parse(@file)
end
def remove_css
@doc.search("svg", "defs").remove
background_image = @doc.xpath('//@style')
@joshuacronemeyer
joshuacronemeyer / rbc_og_tags.html
Last active October 22, 2016 06:49
some basic OG tags for the RBC site
<html>
<head>
...
<!-- Checkout http://ogp.me/ for documentation about Open Graph -->
<!-- After you drop them in. Test/Debug them with this Facebook tool https://developers.facebook.com/tools/debug/ -->
<meta property="og:title" content="Really Bad Chess: Chess With Totally Random Pieces" />
<meta property="og:url" content="http://reallybadchess.com/" />
<meta property="og:description" content="Really Bad Chess is just like chess, but with totally random pieces. Try 8 Knights, 4 Bishops, and 3 pawns — why not? Whether you play chess daily, or quit just after learning the rules, this small twist will open the door to an entire new world of chess." />
<meta property="og:image" content="http://reallybadchess.com/presskit/images/01.png" />
<meta property="og:type" content="website" />
@joshuacronemeyer
joshuacronemeyer / some.html
Created September 7, 2016 21:22
pricing index page snippet
<div class='tour-management tour-management-container vip-meet-and-greet-inventory'>
<div class='row'>
<div class='col-sm-12'>
<h4>Pricing</h4>
</div>
</div>
<div class="itinerary-table">
@joshuacronemeyer
joshuacronemeyer / scheduler_migration.rb
Last active October 5, 2016 06:04
scheduler_migration.rb
#running resque jobs for all queues from a one-off console
worker = Resque::Worker.new("*")
worker.work
#getting all delayed jobs from old resque scheduler
all = Resque.delayed_queue_peek(0,2000).map{|ts| Resque.delayed_timestamp_peek(ts, 0, 2000).map{|it| it[:ts] = ts;it} }
#switch to new redis
Resque.redis = ENV['RESQUE_REDIS_URL']
@joshuacronemeyer
joshuacronemeyer / brian_setzer_custom_landing_page.html
Created July 27, 2016 19:08
customized brian setzer orchestra landing page to have different buy link text for 3 dates
<script type="text/javascript">
$('.center-content-container').hide();
var widgetCallback = function(){
$('[data-event-id=354126] a').replaceWith("On Sale Coming Soon");
$('[data-event-id=354136] a').replaceWith("On Sale Coming Soon");
$('[data-event-id=354128] a').replaceWith("On Sale Coming Soon");
}
var _hello_applauze = [];
_hello_applauze.push({
task: 'subscribe',
@joshuacronemeyer
joshuacronemeyer / emergency_cache.rb
Last active June 28, 2016 21:52
Emergency cache middleware
class EmergencyCache
CACHE_WAS_USED_VERY_RECENTLY_KEY = "event-document-emergency-cache-was-used-recently"
def is_in_emergency_mode?
Rails.cache.exists(CACHE_WAS_USED_VERY_RECENTLY_KEY)
end
def enable_emergency_mode
Rails.logger.error("[EventDocumentEmergencyCache] Using emergency event document cache for next 15 seconds")
@joshuacronemeyer
joshuacronemeyer / allenstone-widget-css
Last active August 29, 2015 14:24
allen stone widget CSS
<style>
/******* APPLAUZE WIDGET *********/
/******* Drop in HTML HEAD *********/
.az-widget-custom-th-notes{
opacity: 0;
}
.az-widget-custom-table{