Giter Club home page Giter Club logo

Comments (3)

chubin avatar chubin commented on May 10, 2024

You mean this for Python?

# Python is a high-level programming language
# and python is a Python interpreter.

# Basic example of server with python
# Will start a Web Server in the current directory on port 8000
# go to http://127.0.0.1:8000
#
# Python v2.7
python -m SimpleHTTPServer
# Python 3
python -m http.server 8000

# SMTP-Server for debugging, messages will be discarded, and printed on stdout.
python -m smtpd -n -c DebuggingServer localhost:1025

# Pretty print a json
python -mjson.tool

# See also:
#   Python language cheat sheets at /python/
#   list of pages:      /python/:list
#   learn python:       /python/:learn
#   search in pages:    /python/~keyword

Yes, currently it shows nothing, but we soon special "menu" page will be shown for all languages including csharp.

What command line C#-related commands would you include in this menu?
Do you have any ideas? What would you like to see there?

from cheat.sh.

davidlfox avatar davidlfox commented on May 10, 2024

I guess I was just pinging some different URL's and nothing C# was working. Is C# implemented?

from cheat.sh.

chubin avatar chubin commented on May 10, 2024

I have checked a couple of queries, and everything works like a charm:

$ curl cht.sh/csharp/copy+file
// C# Copy a file to another location with a different name

System.IO.File.Copy(oldPathAndName, newPathAndName);

// [Marc Gravell] [so/q/3881450] [cc by-sa 3.0]

$ curl cht.sh/csharp/sort+list
/*
 * c# - How to Sort a List<T> by a property in the object
 * 
 * The easiest way I can think of is to use Linq:
 */

List<Order> SortedList = objListOrder.OrderBy(o=>o.OrderDate).ToList();

// [Lazarus] [so/q/3309188] [cc by-sa 3.0]

$ curl cht.sh/csharp/create+file
/*
 * c# - Create a .txt file if doesn't exist, and if it does append a ...
 * 
 * Use the correct constructor (http:msdn.microsoft.com/en-
 * us/library/36b035cb.aspx):
 */

else if (File.Exists(path))
{
    using(var tw = new StreamWriter(path, true))
    {
        tw.WriteLine("The next line!");
    }
}

// [Daniel Hilgarth] [so/q/9907682] [cc by-sa 3.0]

All queries were just random, first things I thought about.
And all of them were 100% hit.
Please try you too

from cheat.sh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.