How to create a md file under windows - windows

I am using git bash under windows because I am having some troubles with Linux right now. I have to make a commit but I have no clue how to create a file with extension .md under the windows platform.
could you please tell me?
Thanks

You doing the Coursera data science course as well? :)
Syntax is:
touch filename.md
Good page I have bookmarked:
http://www.typecastexception.com/post/2012/09/08/Basic-Git-Command-Line-Reference-for-Windows-Users.aspx

An .md (short for MarkDown) is just a text file with some fancy formatting options, like making text between two sets of ** bold (GitHub, e.g., has a pretty comprehensive guide).
You can use any text editor, even Notepad, to create such a file.

Related

How do file extensions work?

I did a quick Google search of "how do Windows extensions work," but it only came up with how to change file extensions.
I was making my own file extension for an image compressor, and as of now you'd have to load the text file into a program and its processed, but in a real-world environment that's not something you want to make people use.
I'm not saying I want to build the next best image compressor but it'd be useful to understand how file extensions work.
I understand a file had content, and the content is defined for use by the extension, but when you execute a file (double click) what happens?
If I click a .x file (example), would there be a bind that has to be done in a system/environment level, to say point to a batch file that runs everything else?
Thanks in advance!

How can I change a .py file to .pyw?

I tried to right click the file and rename it, but it won't even show me the extension so that I could delete it. I also tried going to properties and I couldn't do it from there either. I didn't code directly with the Tkinter of python, I used a custom made graphics library that came with my book.
You are on the right lines in that you just need to rename it - unfortunately modern versions of Windows hide the extension by default so you can't readily modify it.
I tend to set Windows to always display extensions (as this fixes this issue computer-wide), but if this is undesirable or not possible you can always use the command prompt:
cd C:\Path\To\File
ren MyPythonScript.py MyPythonScript.pyw
Hope this helps.

Mac Terminal: How to view a microsoft word file? (It says it is binary)

So I was writing a paper on Microsoft Word and the file is corrupt now. I'm trying to see if I can open the file using vim, but it says it is binary. Is there any command or any way to convert it into text so that I can just vim myfile.doc and copy the text contents? I tried doing a cp myfile.doc myfile.txt to change the extension but it still says it's binary.
A doc file is a proprietary format by Microsoft. Docx formats are xml based but neither can be read directly using a text editor. If your file is corrupt you're probably going to have a lot more luck try to find the autosave location or try and recover the document using the tool office provides. In future remember to back up your work ;)
/usr/bin/strings may be helpful -- built-in to OS X. Hope you can recover your paper.
.doc or .docx is not a plane txt file. It has several formatting and a bit of binary and in .docx xml factor included.
You can go for OpenOffice which is Free.
You might try using Antiword to convert to .txt if it can still access the file properly.
http://en.wikipedia.org/wiki/Antiword
Word itself has an option to "Recover Text From Any File" which is worth trying if you haven't done so already. When you open the file in Word, if it doesn't recognise the format, you should see a conversion dialog and the option is in there. You might have to check the "Confirm conversion at open" option (e.g. "Word Preferences->General->Confirm conversion at open" on Mac Word 2011, "File->Options->Advanced->General->Confirm file format conversion on open" on Windows Word 2010.

How to create a smbolic link over the internet

I would like to be able to create a symbolic link over the internet, that allows you to create a link that e.g. C:\Windows\test.txt to http://www.test.com/test.txt
Is this possible to do?
Is this possible to do?
No. You can create a Windows shortcut, but you can't create a symbolic link to an http site.
Yes. In Windows, a shortuct can either be a .lnk file or a .url file. The former works for local files, while the latter works for URLs.
The .lnk format is a bit difficult to work with manually, but for the sake of your question, you don't need it.
The .url format, on the other hand, is just a plain text file. Example:
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
URL=http://google.com/
IDList=
HotKey=0
IconFile=C:\Program Files\Google\Chrome\Application\chrome.exe
IconIndex=4
To be honest, I don't know what the first two lines are for, but the shortcut still works without them.
You can even generate this file manually.

Notepad++ : Custom Syntax Highlighting for .txt files

I keep code samples that I find useful as text files on my computer. I store them as txt files as opposed to the language in which they are written, so that they will open in Notepad++ instead of the editor (i.e. I don't want my c++ examples to open in an IDE, just Notepad).
Is there a way I can have Notepad++ apply appropriate syntax highlighting to the text file by reading a special code in the text file itself?
For example if I had some sql, the first line of the text file could read like this:
##Language=SQL
... my sql code properly highlighted as sql ...
Thanks in advance. I realize I could just choose the language after opening the file (i.e. Language > SQL), but it would be much more convenient if it could do it automatically.
No, it can't. You can choose it manually or use special file type extensions which you then associate with Notepad++ and tell it to highlight the files as the appropriate language.
For example, use .txtsql files for SQL, .txtcpp files for C++ and so on.
I ended up writing it myself:
You need the Python plugin
Add the code below to your startup.py file
Switch your Python Initialization setting from "LAZY" to "ATSTARTUP"
#if found determine the menu command and switch language in NPP
def switch_language_view(args):
notepad.activateBufferID(args["bufferID"])
lineone = editor.getLine(0)
if '##' in lineone:
lineone = lineone[lineone.rfind('##'):].replace('##', '')
lineone = "MENUCOMMAND." + lineone.upper()
try:
notepad.menuCommand( eval(lineone) )
except:
pass
#command to link notification
notepad.callback(switch_language_view, [NOTIFICATION.FILEOPENED])
I'd suggest giving them the proper file extensions, then import something like this into your registry:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\NotepadPlusPlus]
[HKEY_CLASSES_ROOT\*\shell\NotepadPlusPlus\command]
#="C:\\path\\to\\notepad++.exe \"%1\""
Then you can open your files in NP++ with a quick right-click, and NP++ will be able to auto-detect the right language based on the file extension.
Manual selection is a much simpler way. Store all the files in .txt format (irrespective of java or C or C++). Open the file in Notepad++ and select the corresponding language in the Menu. e.g. Language --> Java.
You could try some npp scripting,
python
lua
and/or hacking macros. you could make the script start conditionally, check your special string and select the language for you.

Resources