Skip to content

Instantly share code, notes, and snippets.

View gsscoder's full-sized avatar
💭
obsessive coding disorder

coder (π³) gsscoder

💭
obsessive coding disorder
View GitHub Profile
#!/bin/sh -x
#This script removes Mono from an OS X System. It must be run as root
rm -r /Library/Frameworks/Mono.framework
rm -r /Library/Receipts/MonoFramework-*
for dir in /usr/bin /usr/share/man/man1 /usr/share/man/man3 /usr/share/man/man5; do
(cd ${dir};
@gsscoder
gsscoder / AssemblyInfo.fs
Created June 18, 2015 10:42
commandline20x-pre_assemblyinfo.fs
(*
* Minimal AssemblyInfo.fs for automatic help screen generation in Command Line Parser Library 2.0.x-pre.
*)
module YourProject.AssemblyInfo
open System.Reflection
[<assembly: AssemblyCopyright("Copyright (c) 2015 Your Name Here")>]
do()
@gsscoder
gsscoder / tga.hs
Created September 21, 2015 16:45
Haskell port of OCaml http://pastebin.com/a66MDZkP
{-|
Haskell port of OCaml http://pastebin.com/a66MDZkP
-}
import qualified Data.ByteString.Lazy as B
import Data.Word8
type Point = (Double, Double)
type Rgb = (Double, Double, Double)
tga :: (Point -> Rgb) -> Int -> Int -> String -> IO ()
@gsscoder
gsscoder / cmdline-snippet-1.cs
Last active December 11, 2015 15:48
Command Line Parser, option declaration pre-1.9.4.91 beta.
[Option("q", "quiet", HelpText = "Suppress summary message.")]
public bool Quiet { get; set; }
@gsscoder
gsscoder / cmdline-snippet-2.cs
Last active December 11, 2015 15:59
Command Line Parser, option declaration post-1.9.4.91 beta.
[Option('q', "quiet", HelpText = "Suppress summary message.")]
public bool Quiet { get; set; }
@gsscoder
gsscoder / cmdline-snippet-3.cs
Created January 24, 2013 16:57
Command Line Parser, verbs sub options.
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-5.cs
Created January 24, 2013 17:02
Command Line Parser, verbs GetUsage.
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 January 24, 2013 17:12
Simple MLState Opa Calculator.
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 / cmdline-snippet-4.cs
Created January 24, 2013 17:00
Command Line Parser, verbs master options.
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 / opa-calc-snippet-1.opa
Created January 24, 2013 17:15
Opa Calculator, Snippet 1.
a = Int.of_string(Dom.get_value(#vala));