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
# frozen_string_literal: true | |
# rubocop:disable Style/Documentation | |
class FlightManager | |
def add_new_flight(flight_number, origin, destination) | |
@flights ||= [] | |
flight = {flight_number: flight_number, origin: origin, destination: destination} | |
already_added = @flights.include?(flight) | |
@flights.push(flight) unless already_added |
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 Context do | |
@moduledoc false | |
defmacro __using__(opts) do | |
repo = Keyword.fetch!(opts, :repo) | |
quote do | |
import Context, only: [context: 1, context: 2] | |
Module.put_attribute(__MODULE__, :__repo__, unquote(repo)) |
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
-- FUNCTION: api.search_job(character varying, integer, integer, integer) | |
-- DROP FUNCTION api.search_job(character varying, integer, integer, integer); | |
CREATE OR REPLACE FUNCTION api.search_job( | |
keyword character varying, | |
rategt integer, | |
ratelt integer, | |
session integer) |
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
```elixir | |
defmodule Riptreaver.API.TargetGroupController do | |
use Riptreaver.Web, :controller | |
plug PolicyWonk.Enforce, roles: [:admin, :advertiser] | |
plug :load_target_groups when action in [:index] | |
plug :load_target_group when action in [:show, :update, :delete, :create_target] | |
plug PolicyWonk.Enforce, :target_group when action in [:show, :update, :delete] | |
alias Riptreaver.{Account, ErrorView} | |
def index(conn, _params) do |
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 NDCThreadRequest do | |
use Timex | |
require Logger | |
alias Timex.Interval, as: Interval | |
def start_thread(provider, request_data, method, consumer) do | |
time_start = Time.now | |
IO.inspect "NDCThread start | Provider: #{provider}" | |
{status, response} = try do |
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 NDCCoreRequest do | |
require Logger | |
def process_request(conn, :AirShopping, query_data, [forwarded_hosts], [consumer]) do | |
forwarded_hosts | |
|> AirlineProfile.get_providers(consumer) | |
|> Enum.map(fn(provider) -> | |
Task.async(fn -> | |
provider | |
|> String.upcase |
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
let scrollstep = 100 | |
set smoothscroll | |
let scrollduration = 200 |
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
<AirShoppingRQ Version="15.2" xmlns="http://www.iata.org/IATA/EDIST" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.iata.org/IATA/EDIST ../AirShoppingRQ.xsd"> | |
<Document> | |
<Name>NDC Wrapper</Name> | |
<ReferenceVersion>1.0</ReferenceVersion> | |
</Document> | |
<Party> | |
<Sender> | |
<ORA_Sender> | |
<AgentUser> | |
<Name>Travel Wadus</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
<AirShoppingRQ Version="15.2" xmlns="http://www.iata.org/IATA/EDIST" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.iata.org/IATA/EDIST ../AirShoppingRQ.xsd"> | |
<Document> | |
<Name>NDC Wrapper</Name> | |
<ReferenceVersion>1.0</ReferenceVersion> | |
</Document> | |
<Party> | |
<Sender> | |
<ORA_Sender> | |
<AirlineID>C9</AirlineID> | |
<Name>Kronos Air</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
defmodule AlivePlug do | |
import Plug.Conn | |
def init(opts) do | |
opts | |
end | |
def call(conn, _opts) do | |
conn = send_chunked(conn, 200) | |
# send initial chunk |
NewerOlder