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
[~/Developer/ScalaMono]% scalac-net ScalaMono.scala | |
[~/Developer/ScalaMono]% ilasm ScalaMono.msil | |
Assembling 'ScalaMono.msil' , no listing file, to exe --> 'ScalaMono.exe' | |
Operation completed successfully | |
[~/Developer/ScalaMono]% mono ScalaMono.exe | |
Scala on Mono! fib (0) = 1 | |
Scala on Mono! fib (1) = 1 | |
Scala on Mono! fib (2) = 2 | |
Scala on Mono! fib (3) = 3 |
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 System._ | |
object ScalaMono extends Application { | |
def fib (i: Int): Int = i match { | |
case 0 | 1 => 1 | |
case i => fib (i - 2) + fib (i - 1) | |
} | |
for (i <- 0 until 10) { |
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
[~/Developer/ScalaMono]% time mono ScalaMono.exe | |
Scala on Mono! fib (0) = 1 | |
Scala on Mono! fib (1) = 1 | |
Scala on Mono! fib (2) = 2 | |
Scala on Mono! fib (3) = 3 | |
Scala on Mono! fib (4) = 5 | |
Scala on Mono! fib (5) = 8 | |
Scala on Mono! fib (6) = 13 | |
Scala on Mono! fib (7) = 21 | |
Scala on Mono! fib (8) = 34 |
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
[~/Developer/ScalaMono]% cat ScalaMono.scala | |
object ScalaMono extends Application { | |
def fib (i: Int): Int = i match { | |
case 0 | 1 => 1 | |
case i => fib (i - 2) + fib (i - 1) | |
} | |
println (fib (35)) | |
} | |
[~/Developer/ScalaMono]% time mono ScalaMono.exe |
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
using System; | |
using System.Collections.Generic; | |
using MonoMac.Foundation; | |
using MonoMac.AppKit; | |
using MonoMac.ObjCRuntime; | |
using Cadenza; | |
namespace MySecretApp { |
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
private static IEnumerable<TSource> SkipWhileImpl<TSource>( | |
IEnumerable<TSource> source, | |
Func<TSource, bool> predicate) | |
{ | |
return SkipWhileImpl (source, (element, index) => predicate (element)); | |
} |
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
#!/usr/bin/runhaskell | |
import Data.List | |
import Control.Monad | |
import System.Process (readProcess) | |
import System.Environment (getArgs) | |
import System.Directory (doesFileExist, removeFile) |
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
#!/usr/bin/ruby | |
ARGV.group_by { | |
|file| `md5 #{file}`.split.last | |
}.values.map { | |
|dups| dups.drop 1 | |
}.flatten.each { | |
|dup| File.delete dup | |
} |
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
using System; | |
using System.IO; | |
using System.Diagnostics; | |
using MonoMac.AppKit; | |
using MonoMac.Foundation; | |
namespace Awareness | |
{ | |
public static class NSApplicationExtensions |
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
SSH_ENV="$HOME/.ssh/environment" | |
# start the ssh-agent | |
function start_agent { | |
echo "Initializing new SSH agent..." | |
# spawn ssh-agent | |
ssh-agent | sed 's/^echo/#echo/' > "$SSH_ENV" | |
echo succeeded | |
chmod 600 "$SSH_ENV" | |
. "$SSH_ENV" > /dev/null |