This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule ReaperWeb.Plugs.ScoutApmAbsinthe do | |
@moduledoc """ | |
This plug allows us to add context to our GraphQL requests in Scout. | |
We are intuiting the operation name from the query itself and attaching it | |
to a Scout layer | |
""" | |
alias ScoutApm.Internal.Layer | |
alias Reaper.MetaLogger, as: Logger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomersController < ApplicationController | |
include CustomersHelper | |
def lookup_phone | |
customer_data = Customer.customer_data_by_type('phone', params[:PhoneNumber]) | |
reset_device(customer_data) | |
Customer.customer_data_to_json(customer_data) | |
end | |
def lookup_account_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<head> | |
<style> | |
.row { | |
margin: 10px 0; | |
} | |
input { | |
width: 200px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Force Pull (on a release, get updated production / preproduction) | |
------------------------------------------------------- | |
git fetch --all | |
git reset --hard origin/master | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
var url = 'http://google.com'; | |
var dialog_form = $('<div id="dialog-form">Loading form...</div>').dialog({ | |
autoOpen: false, | |
width: 520, | |
modal: true, | |
open: function() { | |
return $(this).load(url + ' #content'); | |
}, | |
close: function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TreeNode | |
attr :children | |
attr_reader :parent | |
def name=(value) | |
@name=value | |
end | |
def name | |
@name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = %w(a b c d e) | |
x.cycle(x.length) do | |
y = x.sample | |
p y | |
x.delete(y) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
m = %w(.- -... -.-. -.. . ..-. --. .... .. .--- -.- .-.. -- -. --- .--. --.- .-. ... - ..- ...- .-- -..- -.-- --..) | |
z = Hash[*m.zip(("A".."Z").to_a).flatten] | |
arr = [] | |
morse.split(" ").each do |x| | |
x.split(" ").each do |y| | |
arr << z[y] | |
end | |
arr << " " | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h3>Select the Number of Guests Before Proceeding: <label for="guests"></label></h3> | |
<select name="guests" id="guests" class="span1"> | |
<option value="1">1</option> | |
<option value="2">2</option> | |
<option value="3">3</option> | |
<option value="4">4</option> | |
<option value="5">5</option> | |
<option value="6">6</option> | |
</select> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Here is the rake task I've created. The API has a little quirk though -- I'm calling 'subcontinent,' but it isn't #working because the subcontinent is stored in the name property (i.e. <subcontinent name="England">). For reference, #the API file I'm referring to is here: http://www.instantworldbooking.com/xml/files/locations.xml | |
# Aside from the first loop, the rest of the should work. I may have to find a way around populating an array with the #locations (such as copying the results and reformatting them - I just need a list of countries from that file). Once I #have the list of locations, I can continue (I'm not sure how to run the rake task yet) | |
"desc" | |
task | |
# make an array of all countries that the api supports -- STILL NEED TO FIGURE OUT HOW TO GET THIS FROM API | |
response = HTTParty.get("http://www.instantworldbooking.com/xml/files/locations.xml") | |
country = response['locations']['continent']['subcontinent'] |