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
require "active_model" | |
require File.dirname(__FILE__) + "/base" | |
module Command | |
class Find < Base | |
include ActiveModel::API | |
include ActiveModel::Validations | |
attr_accessor :x, :y |
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
"use strict"; | |
exports._getNetworkId = window.cardano.getNetworkId; |
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
import fetch_, { RequestInfo, RequestInit, Response } from "node-fetch"; | |
import * as T from "@effect-ts/core/Effect" | |
import { Tagged } from "@effect-ts/core/Case"; | |
export class HttpError extends Tagged("http-error")<{ | |
readonly error: unknown; | |
}> { } | |
export const fetch = (url: RequestInfo, opts?: Omit<RequestInit, "signal">) => | |
T.effectAsyncInterrupt<unknown, HttpError, Response>((cb) => { |
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
interface Vehicle { | |
fun go(): String | |
} | |
class CarImpl(val where: String): Vehicle { | |
override fun go() = "is going to $where" | |
} | |
class AirplaneImpl(val where: String): Vehicle { | |
override fun go() = "is flying to $where" | |
} | |
class CarOrAirplane( |
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
module BuyLocal.AppM where | |
import Prelude | |
import BuyLocal.Capability.BusinessService (class BusinessRepo) | |
import BuyLocal.Env (Env) | |
import BuyLocal.Platform.Database (withConnection) | |
import Control.Monad.Except (runExceptT) | |
import Control.Monad.Logger.Class (class MonadLogger) | |
import Control.Monad.Reader (ask) | |
import Control.Monad.Reader.Trans (class MonadAsk, ReaderT, asks) |
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's the code binds to the port | |
mkServer :: Env -> HTTPure.ServerM | |
mkServer env = do | |
mPort <- lookupEnv "PORT" | |
let | |
port = fromMaybe 8080 $ fromString =<< mPort | |
HTTPure.serve port (middleware env router) do | |
Console.log $ "Server running on " <> show port |
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
puts PartnerUser.find(7208).inspect | |
STDOUT.flush |
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
"use strict"; | |
exports.getCurrentPositionImpl = function (options) { | |
return function (geolocation) { | |
return function (onError, onSuccess) { | |
geolocation.getCurrentPosition(onSuccess, onError, options); | |
return (cancelError, onCancelerError, onCancelerSuccess) => { | |
onCancelerSuccess(); | |
}; |
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
puts PayeeInwardAccountConfig.find(67).inspect | |
STDOUT.flush |
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
puts PolicyApplication.find_by(reference: 'OSHC7050908244').versions |
NewerOlder