This file contains hidden or 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
| package au.com.mebank.bfamdesplayground.repositories | |
| import com.mastercard.api.core.ApiConfig | |
| import com.mastercard.api.core.model.RequestMap | |
| import com.mastercard.api.core.security.mdes.MDESCryptography | |
| import com.mastercard.api.core.security.oauth.OAuthAuthentication | |
| import org.springframework.util.ResourceUtils | |
| import java.io.FileInputStream | |
| import com.mastercard.api.mdestokenconnect.PushAccount |
This file contains hidden or 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
| Parameters: { | |
| "timestamp"=>1563420412, | |
| "project_id"=>15281680010, | |
| "data"=>{"cdn_url"=>"https://cdn.optimizely.com/datafiles/2sGNLZVuHGeEXKAmKc92mo.json", | |
| "environment"=>"Production", | |
| "origin_url"=>"https://optimizely.s3.amazonaws.com/datafiles/2sGNLZVuHGeEXKAmKc92mo.json", | |
| "revision"=>71}, | |
| "event"=>"project.datafile_updated", "optimizely"=>{"timestamp"=>1563420412, "project_id"=>15281680010, | |
| "data"=>{"cdn_url"=>"https://cdn.optimizely.com/datafiles/2sGNLZVuHGeEXKAmKc92mo.json", | |
| "environment"=>"Production", "origin_url"=>"https://optimizely.s3.amazonaws.com/datafiles/2sGNLZVuHGeEXKAmKc92mo.json", |
This file contains hidden or 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
| import * as optimizelySDK from "@optimizely/js-web-sdk"; | |
| import OptimizelySingleton from "./index"; | |
| describe("OptimizelySingleton", () => { | |
| const localIsFeatureEnabled = jest.fn(); | |
| beforeEach(() => { | |
| optimizelySDK.createInstance = jest.fn(() => ({ | |
| isFeatureEnabled: (featureName, userId) => localIsFeatureEnabled(featureName, userId), | |
| })); |
This file contains hidden or 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
| private fun first(a: Int): Result<Int?> = | |
| when(a % 2 == 0) { | |
| true -> Result.success(value = a) | |
| false -> Result.failure(Exception("$a is odd")) | |
| } | |
| private fun second(a: Int?): Result<Int?> = Result.failure(Exception("Because!")) | |
| private fun third(a: Int?): Result<Int?> = | |
| when(a?.compareTo(10)) { |
This file contains hidden or 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
| package blog.guidobarbaglia.models | |
| import java.time.LocalDateTime | |
| data class Transaction(val creditCardNumber: String, val amount: Double, val timestamp: LocalDateTime) |
This file contains hidden or 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 SwitchWeb.ETSServiceTest do | |
| use ExUnit.Case | |
| @cache_name :switches_cache | |
| @value_1 "eggs" | |
| @value_2 "bacon" | |
| test "initialize cache" do | |
| initialize() |
This file contains hidden or 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 Sandbox do | |
| def hello do | |
| [1, 3, 5, 7] | |
| |> Flow.from_enumerable() | |
| |> Flow.map(&get(&1)) | |
| |> Flow.map(&process(&1)) | |
| |> Flow.reduce(fn -> [] end, fn value, acc -> [value | acc] end) | |
| |> Enum.to_list | |
| |> IO.inspect |
This file contains hidden or 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
| Properties( | |
| id int NOT NULL PRIMARY KEY, | |
| location_id FOREIGN KEY REFERENCES Locations(id), | |
| rent int, | |
| created_at date | |
| ) |
This file contains hidden or 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
| import RPi.GPIO as GPIO | |
| import time | |
| GPIO.setmode(GPIO.BCM) | |
| GPIO_PIN = 24 | |
| GPIO.setup(GPIO_PIN, GPIO.IN, pull_up_down = GPIO.PUD_UP) | |
| delayTime = 0.5 | |
This file contains hidden or 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
| import Tizio | |
| {:ok, source} = Tizio.Source.start_link(%{:spam => "eggs"}) | |
| {:ok, consumer} = Tizio.Consumer.start_link(42) | |
| {:ok, another_consumer} = Tizio.AnotherConsumer.start_link(42) | |
| GenStage.sync_subscribe(consumer, to: source) | |
| GenStage.sync_subscribe(another_consumer, to: source); |