Skip to content

Instantly share code, notes, and snippets.

View mattiamanzati's full-sized avatar
💭
undefined is not a function

Mattia Manzati mattiamanzati

💭
undefined is not a function
View GitHub Profile
#Region "Scarica dati capo"
Public Overridable Function ScaricaInformazioniCapo(ByVal strCodCapo As String, ByRef datNas As Date, ByRef strSesso As String, ByRef strRazza As String, ByRef strLog As String) As Boolean
Dim client As RestClient
Dim request As RestRequest
Dim response As RestResponse
Dim strCodAic As String = ""
Dim strContent As String = ""
Dim strTmp As String()
const SorN = t.union([t.literal("S"), t.literal("N")])
export class FlagSN extends t.Type<boolean, "S" | "N", unknown> {
readonly _tag: 'FlagSN' = 'FlagSN'
constructor() {
super('FlagSN', t.boolean.is, (u, c) => pipe(
SorN.validate(u, c),
E.map(tof => tof === 'S')
), v => v ? 'S' : 'N')
}
import {cmd} from 'elm-ts'
// TODO: See what's Option from functional programming
type Option<A> = {
type: 'none'
} | { type: 'some', value: A}
/**
* This is the users updater, it stores a list of user objects and exposes selectors to get them
*/
// https://swapi.graph.cool/
{
allFilms(
filter: {
releaseDate_gte: "2000-01-01T21:03:41.108Z"
releaseDate_lte: "2010-01-01T21:03:41.108Z"
}
){
title
releaseDate
import { Alt1, Alt, Alt2 } from 'fp-ts/lib/Alt'
import { Apply1, Apply, Apply2 } from 'fp-ts/lib/Apply'
import { Chain1, Chain, Chain2 } from 'fp-ts/lib/Chain'
import { Eq } from 'fp-ts/lib/Eq'
import { Extend1, Extend, Extend2 } from 'fp-ts/lib/Extend'
import { Foldable1, Foldable, Foldable2 } from 'fp-ts/lib/Foldable'
import { FoldableWithIndex1, FoldableWithIndex, FoldableWithIndex2 } from 'fp-ts/lib/FoldableWithIndex'
import { Functor1, Functor, Functor2 } from 'fp-ts/lib/Functor'
import { FunctorWithIndex, FunctorWithIndex2, FunctorWithIndex1 } from 'fp-ts/lib/FunctorWithIndex'
import { HKT, Type, URIS, URIS2, Type2 } from 'fp-ts/lib/HKT'
// OUTPUT
{
"oneOf": [
{
"properties": {}
}
],
"title": "Business Boolean",
"description": "Business uses S/N as boolean values instead of 0/1",
"type": "string"
// do precedenza alle cose ambigue
$tweet = Tweet::query()
->orderBy('votes_total', 'ASC')
->inRandomOrder()
->where('votes_total', '<', 10)
->where('votes_total', '>', 0)
->where('votes_category', '!=', DB::raw('predicted_category'))
->first();
if(!empty($tweet)) return $tweet;
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
type Override<T, K extends keyof T, V> = Omit<T, K> & { [N in K]: V }
type AnyStateConfig = {
type: "initial" | "state" | "final"
states: {[K: string]: AnyStateConfig}
}
type EmptyStateConfig = {
type: "state"
import * as t from "io-ts"
import {taskEither, TaskEither} from "fp-ts/lib/TaskEither"
import {Either, either} from "fp-ts/lib/Either"
import { Task } from 'fp-ts/lib/Task';
export type IFieldObserver<T> = (newValue: T) => TaskEither<any, void>
export type IFieldInterceptor<T> = (newValue: T) => TaskEither<any, T>
export interface IDisposer extends TaskEither<void, void>{}