Zip from the Windows command line

- Posted in Coding by

If a valid subdirectory is passed in as an argument on the command-line, will zip it to .zip file that is located in same directory as executing code:

download sourcecode

Get full path of executing assembly

- Posted in Coding by

C# code to get the full path of the executing assembly:

<script src="https://gist.github.com/kyrathasoft/825c2c277bdaed4d300880415f72ab5b.js"></script>

then there's also this:

<script src="https://gist.github.com/kyrathasoft/4f4f1d6639c6faff0b2e4c77e60ede87.js"></script>

using System;
using System.Reflection; //required for Assembly namespace
using System.IO; //required for Path namespace

namespace HelloWorld {
class Hello {

    static void Main(string[] args){
        Console.WriteLine("n Now executing: {0}", ExecutingAssemblyPath());
        Console.Write("n Press any key to exit... ");
        Console.ReadKey();
        Console.WriteLine();
    }

    public static string ExecutingAssemblyPath(){
    string path = AppDomain.CurrentDomain.BaseDirectory;
    string fname = Assembly.GetEntryAssembly().GetName().Name;
    path += fname;
    if(File.Exists(fname + ".exe")){ path += ".exe"; } else {path += ".dll"; }
        return path;
    }    

  }
}

I'm very interested in Twine

- Posted in Coding by

I've been interested in Twine 2.0 since it emerged onto the IF scene in 2009. But I only recently (August 2019) revisited it and began to experiment with it in earnest. As I nail down concepts, achieve insights, and come up with snippets of script that work, I'm collecting them here.

Some credit goes to Chapel and the code and examples he's made available on the Twine lab under this license.

I keep a copy of the Windows version 2.3.3 of Twine here. It's an 84.8 Mb download.

If you want a zero-install Twine engine, with some additional story formats and an extractible Web-to-Exe that can turn your Twine stories into stand-alone applications, get this. It's an 85.8 Mb download. You can put it wherever you want on your hard drive (excepting the Program Files directory) and pin a shortcut to the Twine executable to your Start Menu or Desktop.

If you experiment with Twine and decide you want to spend some extended time using it, you may want to peruse Chapel's custom macros. You can put together a custom download of the macros you like here.

Get top level subdirectories from a given directory

- Posted in Coding by

Here is a program demonstrating how to get the names of the top-level subdirectories in a given directory: