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 { HKT, Kind, Kind2, URIS, URIS2 } from "fp-ts/lib/HKT"; | |
import * as IO from "fp-ts/lib/IO"; | |
import * as TR from "fp-ts/lib/Tree"; | |
import { pipe } from "fp-ts/lib/function"; | |
import * as O from "fp-ts/lib/Option"; | |
import { Lens } from "monocle-ts"; | |
type MarsElementProps = { | |
disabled: false; | |
hidden: false; |
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 React from 'react' | |
interface ButtonProps { | |
shape: 'circle'|'rectangle'|'oval' | |
} | |
function Button(props: ButtonProps) { | |
// renders some pretty button | |
return <button>Heyo</button> | |
} |
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
#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() |
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
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') | |
} |
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 {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 | |
*/ |
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
// https://swapi.graph.cool/ | |
{ | |
allFilms( | |
filter: { | |
releaseDate_gte: "2000-01-01T21:03:41.108Z" | |
releaseDate_lte: "2010-01-01T21:03:41.108Z" | |
} | |
){ | |
title | |
releaseDate |
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 { 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' |
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
// OUTPUT | |
{ | |
"oneOf": [ | |
{ | |
"properties": {} | |
} | |
], | |
"title": "Business Boolean", | |
"description": "Business uses S/N as boolean values instead of 0/1", | |
"type": "string" |
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
// 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; |
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
"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) { |