Skip to content

Instantly share code, notes, and snippets.

Giacomo Stelluti Scala gsscoder

Block or report user

Report or block gsscoder

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gsscoder
gsscoder / cmdline-snippet-1.cs
Last active Dec 11, 2015
Command Line Parser, option declaration pre-1.9.4.91 beta.
View cmdline-snippet-1.cs
[Option("q", "quiet", HelpText = "Suppress summary message.")]
public bool Quiet { get; set; }
@gsscoder
gsscoder / cmdline-snippet-2.cs
Last active Dec 11, 2015
Command Line Parser, option declaration post-1.9.4.91 beta.
View cmdline-snippet-2.cs
[Option('q', "quiet", HelpText = "Suppress summary message.")]
public bool Quiet { get; set; }
@gsscoder
gsscoder / cmdline-snippet-3.cs
Created Jan 24, 2013
Command Line Parser, verbs sub options.
View cmdline-snippet-3.cs
class CommitSubOptions
{
[Option('p', "patch",
HelpText = "Use the interactive patch selection interface to chose which changes to commit.")]
public bool Patch { get; set; }
[Option('a', "all",
HelpText = "Tell the command to automatically stage files that have been modified.")]
public bool All { get; set; }
}
@gsscoder
gsscoder / cmdline-snippet-4.cs
Created Jan 24, 2013
Command Line Parser, verbs master options.
View cmdline-snippet-4.cs
class Options
{
public OptionsWithVerbsHelp()
{
CommitVerb = new CommitSubOptionsHelp {Patch = true};
}
[VerbOption("add", HelpText = "Add file contents to the index.")]
public AddSubOptions AddVerb { get; set; }
@gsscoder
gsscoder / cmdline-snippet-5.cs
Created Jan 24, 2013
Command Line Parser, verbs GetUsage.
View cmdline-snippet-5.cs
class Options : CommandLineOptionsBase
{
// option attributes as above...
[HelpVerbOption]
public string GetUsage(string verb)
{
bool found;
var instance = (CommandLineOptionsBase) CommandLineParser.GetVerbOptionsInstanceByName(verb, this, out found);
var verbsIndex = verb == null || !found;
var target = verbsIndex ? this : instance;
@gsscoder
gsscoder / easycalc.opa
Created Jan 24, 2013
Simple MLState Opa Calculator.
View easycalc.opa
function sum()
{
a = Int.of_string(Dom.get_value(#vala));
b = Int.of_string(Dom.get_value(#valb));
#res = a + b;
}
function start() {
<div>EasyCalc</div>
<div>
@gsscoder
gsscoder / opa-calc-snippet-1.opa
Created Jan 24, 2013
Opa Calculator, Snippet 1.
View opa-calc-snippet-1.opa
a = Int.of_string(Dom.get_value(#vala));
@gsscoder
gsscoder / closure-conf.cs
Last active Nov 7, 2019
Illustrates how to configure an object using closures in C#
View closure-conf.cs
class Program
{
static void Main(string[] args)
{
var obj1 = new ToBeConfigured(with =>
{
with.UseB();
with.SetParam("something");
});
@gsscoder
gsscoder / RenameFixtureMethods.fs
Last active Nov 7, 2019
Simple F# program to rename my C# test fixture methods
View RenameFixtureMethods.fs
(*
Description: Simple program to change naming conventions of my C# test fixtures.
Purpose: Learn F#!
Author: Giacomo Stelluti Scala
Created: 2013-01-28
*)
open System
open System.IO
open System.Globalization
open System.Text
You can’t perform that action at this time.