cheat.sh
cheat.sh copied to clipboard
Default intro page for programming language sections (e.g. /csharp/)
trafficstars
e.g. https://cheat.sh/csharp shows the following:

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?
I guess I was just pinging some different URL's and nothing C# was working. Is C# implemented?
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