Skip to content

Instantly share code, notes, and snippets.

View teo-tsirpanis's full-sized avatar

Theodore Tsirpanis teo-tsirpanis

View GitHub Profile
@teo-tsirpanis
teo-tsirpanis / ScratchBuffer.cs
Created December 13, 2021 21:57
GC-friendly scratch buffers of arbitrary size in C# made easy.
// Written by Theodore Tsirpanis.
// Licensed under the CC0 license.
// SPDX-License-Identifier: CC0-1.0
using System.Buffers;
#nullable enable
/// <summary>
/// Manages temporary buffers with low GC pressure.
@teo-tsirpanis
teo-tsirpanis / AstRcd.fs
Last active October 22, 2017 16:40 — forked from ctaggart/AstRcd.fs
Generating F# code using its AST
module Fantomas.AstRcd
open System
open Microsoft.FSharp.Compiler.Ast
open Microsoft.FSharp.Compiler.Range
type ParsedImplFileInputRcd = {
File: string
IsScript: bool
QualName: QualifiedNameOfFile
@teo-tsirpanis
teo-tsirpanis / collatz.fs
Created October 7, 2017 17:04
A verifier of the Collatz conjecture in F#, annotated with Greek comments.
// Η εικασία του Collatz στην F#, με επεξηγήσεις.
// Θοδωρής Τσιρπάνης, 3/10/2017. Άδεια χρήσης: CC0
// Αυτό το πρόγραμμα έπαληθεύει την εικασία του Collatz. https://en.wikipedia.org/wiki/Collatz_conjecture
// Είναι γραμμένο στην F# και έχει εκτεταμένους σχολιασμούς με σκοπό την εισαγωγή στις δυνατότητες της γλώσσας.
// Μία βασική εξοικείωση με τον προγραμματισμό και με τα μαθηματικά απαιτείται για την πλήρη κατανόηση του προγράμματος.
// Στο System βρίσκονται οι πιο βασικές μέθοδοι του συστήματος.
// Αν και εδώ χρησιμοποιούμε μόνο το Console.ReadLine και το UInt64.TryParse.
// Η πρότυπη βιβλιοθήκη της F# είναι στο namespace "Microsoft.FSharp" το οποίο ανοίγει αυτόματα.
@teo-tsirpanis
teo-tsirpanis / ablock.txt
Created January 20, 2017 19:01
AdBlock Plus Power Pack
##.truste_overlay
##.overlay-container
##.truste_box_overlay
##._ovg3g
@teo-tsirpanis
teo-tsirpanis / pokemon.fs
Created December 4, 2016 11:36
An F# script that makes a list of all Pokemon and their Pokedex ID, sorted by name.
// An F# script that makes a list of all Pokemon and their Pokedex ID, sorted by name.
// Created by Theodore Tsirpanis
// Placed into the public domain, and licensed under CC0.
#r "System.Xml.Linq"
#r "packages/FSharp.Data/lib/net40/FSharp.Data.dll"
open FSharp.Data
open System.IO
[<Literal>]