Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Giacomo Stelluti Scala gsscoder

💭
I may be slow to respond.
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 / process_darwin.go
Created May 29, 2015
From github.com/gsscoder/goproc as in commit 13a38b6100.
View process_darwin.go
// Copyright 2015 Giacomo Stelluti Scala. All rights reserved. See doc/License.md in the project root for license information.
package process
/*
#include <stdlib.h>
#include "libproc.h"
*/
import "C"
import "unsafe"
@gsscoder
gsscoder / process_darwin-2.go
Created May 31, 2015
From github.com/gsscoder/goproc as in commit 998e482ecd.
View process_darwin-2.go
// Copyright 2015 Giacomo Stelluti Scala. All rights reserved. See doc/License.md in the project root for license information.
package process
/*
#include <stdlib.h>
#include "libproc.h"
*/
import "C"
import "unsafe"
View uninstall-mono.sh
#!/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 Jun 18, 2015
commandline20x-pre_assemblyinfo.fs
View 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()
View tga.hs
{-|
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 ()
View RandomArt.hs
{-|
Haskell port of F# http://fssnip.net/si
-}
import Control.Applicative ((<$>), (<*>))
import System.Random (randomIO, randomRIO)
import qualified Data.ByteString.Lazy as B
import Data.Word8
data Expr =
VariableX
@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-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;
You can’t perform that action at this time.