Skip to content

Instantly share code, notes, and snippets.

View leomayleomay's full-sized avatar

Hao Liu leomayleomay

View GitHub Profile
"use strict";
exports._getNetworkId = window.cardano.getNetworkId;
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) => {
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(
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)
// 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
puts PartnerUser.find(7208).inspect
STDOUT.flush
"use strict";
exports.getCurrentPositionImpl = function (options) {
return function (geolocation) {
return function (onError, onSuccess) {
geolocation.getCurrentPosition(onSuccess, onError, options);
return (cancelError, onCancelerError, onCancelerSuccess) => {
onCancelerSuccess();
};
puts PayeeInwardAccountConfig.find(67).inspect
STDOUT.flush
puts PolicyApplication.find_by(reference: 'OSHC7050908244').versions
Premium.where(id: [314233, 314205, 314177, 314149]).update_all(list_price: 242.44)
Premium.where(id: [314230, 314202, 314174, 314146]).update_all(list_price: 96.97)
Premium.where(id: [314232, 314231, 314204, 314203, 314176, 314175, 314148, 314147]).update_all(list_price: 193.93)