what is the best way to remember/manage/save code you will need again f.e. install anaconda on Linux - save

I m doing my first steps on Linux and I know I will need to look up a lot of installation codes I already made ones but will have to do it also on another VM.
What is the best way to save the snippets to find them later faster and no need to look them up again on youtube?
Is there a nice way or do I just save them as .txt-files in my folders?
THX

Related

What is the best way to move updated files from Mac/windows

I'm very new to coding and building my first rails website.
I use a Mac laptop to edit when I'm not home and a windows desktop. Up until now I've been using Dropbox to store the files and uploading/downloading from there when required.
The last time I tried uploading from my Mac, it didn't copy many files at all and I was wondering what the best way to do this going forward would be?
I'd use a proper version control system, such as git or mercurial. So you'd upload your code to a central repository (github, for example) from your mac and get/fetch these latest updates on windows. And vice versa.
This might seem like an overly complicated solution to this problem, but you'll have to learn version control anyway. Might as well start now.

Saving Python code in Anaconda

I am having problems saving the Python code in Anaconda. I write code, Go to File Save as the file is saved but when I open it is empty, no code. I read that IDLE does not save code, it erases it when I close Anaconda.
I have searched in books, youtube tutorials and nothing. I could not find this topic. I can find advanced topics, but this one no.
Thank you for your help!
Best,
Tiberiu
This somewhat depends on what OS you are on. I can speak from my experience. I would highly recommend using PyCharm as an IDE.
But more fundamentally than that, lets talk about saving files. On Mac OS X or Ubuntu 14.04 (or the like), lets say you want to create a python file. One way is to do the following in a terminal:
nano hello.py
This opens up a text editor whose instructions for use are on the bottom of the screen. On Windows you could do:
notepad hello.py
In both cases you then write your code. Lets say the content was:
#content of hello.py
print "Hello World!"
Then you need to save the file and execute it with Python.
Which brings us to the Python issue.
Once you have installed Anaconda, and assuming that there are no other Python installations on your computer. The Anaconda Python should be the active Python on system.
Suffice to say that there are other ways of saving files rather than using IDLE. Personally I have found PyCharm to be a much better IDE for writing Python code.
To address the IDLE issue more directly once you type in the terminal/command prompt idle to launch an IDLE session, likely the IDLE Shell will open up. Perhaps you are trying to save this, in which case you will only save the Shell session.
So go to File - New - Save. This should work without any problem (it does on my system). Good luck! Hope this helps.

Collection of PNaCl ports with compiled .pexe files (Ex: ImageMagick)?

The list of current NaCl ports is here: https://code.google.com/p/naclports/wiki/PortList
I'm curious if there is (or will be) a repository for PNaCl executables (.pexe files) since they only need a .nmf manifest wrapper to run?
Please list any PNaCl resources here, I'm looking for ImageMagick specifically.
I know I could probably build the .pexe myself but I don't have the time to learn Native Client.
The short answer is: this isn't available yet, but we are working on it.
The long answer:
There isn't currently a binary repository for naclports. We are planning to add that soon (likely this quarter).
I took a quick look at the ImageMagick port, and it looks like it currently only generates libraries, not an application binary (i.e. nexe/pexe). My guess is that it wouldn't be too hard to add this, however.
Even with a pexe, you'll need to have a way to launch the application, give it commandline options, and a set of files to process. I've discussed a way to do this with my team, but we haven't started work on it yet (though again, we'll likely work on this in Q1 2014).

Thinking of moving from TextMate to vim for Rails dev. What do I need?

I do Ruby on Rails development pretty much exclusively. I currently develop in OS X using TextMate. I have a virtual machine running to emulate as closely as possible the environment my app will be deployed into, and I mount the code on a Samba share into OS X from the VM guest. From there I open with TextMate and code away.
I'm beginning to think that with the proper plugins and time spent learning, I could be much more productive in vim directly on the VM. Right now my TextMate is basically stock, though I do find the ProjectPlus plugin indispensable. What I'm looking for are some suggestions of vim resources and plugins (if that's the right terminology) to closely emulate the features I am unwilling to give up in TextMate. Or at least, compelling reasons why I should be willing to give them up. Here's a short list:
Ability to have a (preferably) collapsible project tree visible either at all times or easily toggle-able.
Ability to see SCM status at a glance, either within this project tree (preferable) or otherwise. (I use git almost exclusively if this makes any difference.)
Being able to view a side-by-side diff from within vim would be great too
Ability to search through the entire project at will (I suppose :stop; grep -nr; fg; would accomplish this, unless there's a better way to do it.)
Code completion, if possible
The NERD Tree plugin gives you a collapsible project tree. Personally, I find that the netrw plugin is more than sufficient, and this usually comes installed with Vim. Whereas the NERD tree feels as though it tries to emulate the behaviour of other IDEs (and TextMate's project drawer), I feel that the netrw plugin does things the Vim way. I suggest you try both out, and see which one you prefer.
The fugitive plugin provides a git interface to Vim (See Vimcasts: parts 1, 2, 3, 4 and 5).
The ack plugin is great for searching an entire project. You'll want to read up on Vim's quickfix list to get the most out of this.
TextMate's word completion is triggered with esc, and shift-esc. In Vim, you get similar autocomplete functionality using ctrl-n and ctrl-p in insert mode. Check :help ins-completion for (much!) more info.
I am running a series of screencasts about learning Vim over at vimcasts.org. My background is with TextMate, but I've been using Vim fulltime for a while now. As I write this, I'm only 6 episodes in, but I do plan on covering each of the points you've raised in future episodes. I'll try and come back to edit this answer with links to the screencasts as they become available.
And snipMate : TextMate-style snippets for Vim
I'm currently in a similar position to you (moving from TextMate to Vim)
One really good resource is this:
http://robots.thoughtbot.com/post/166073596/intro-rails-vim
Good luck with it!
For file navigation is simply love CommandT
This functions very much the same as the beloved commandT function in textmate.
You might want to start with my Ruby/Rails related vimfiles which includes support for rvm and git.
This screencast is great as well http://blip.tv/file/1372096
I do use VIM and i specially like how to rotate from model/view and controller related..
Check out the blog post: From Textmate to VIM for Rails coders.
The comments there may also valuable for you.
All of the other answers plus:
Ability to have a (preferably) collapsible project tree visible either at all times or easily toggle-able.
The project.vim plugin doesn't really work like TextMate's Project drawer but it's close.
With NERDTree, you can setup bookmarks and make it work a little like a project drawer.
:help mkview and :help mksession can help, too.
Ability to see SCM status at a glance, either within this project tree (preferable) or otherwise. (I use git almost exclusively if this makes any difference.)
vcscommand.vim provides the same set of commands for multiple SCMs, it works with Git, SVN, Mercurial…
You can use the aforementioned fugitive plugin to display the Git status in the status line, :help fugitive-statusline.
Being able to view a side-by-side diff from within vim would be great too
fugitive provides the :Gdiff command that does just that.
A recently released plugin called Gitv tries to emulate GitK in Vim. I like it a lot and the author is very responsive. In the tree view, hit <CR> to open a previous commit in another window and D to see a double diff.
Code completion, if possible
There are a few solutions, if you don't need it to be automatic <C-x><C-o>, <C-n> and <C-p> will be more than enough, if you want "autocompletion" you may try these few plugins. My favorite is autocomplpop.
Search an entire project here.
Code completion: Normally done with ctrl-X then ctrl-O while in insert mode.
Git Integration: git.vim
Project Tree: Nerdtree.vim
Good luck
I published an extended post on this topic today, in which I explain how to replicate 100 features from Textmate within VIM. It's the product of a great deal of hours research.
For example I explain:
How to replicate a Project Drawer
How to manage tabs
How to do Rails specific commands (Lets face it: A lot of Textmate users are Rails programmers)
How to do find and replaces
How to do project wide searches
Read Original Article: Textmate To VIM

Is it possible to create a custom distribution of OpenOffice, or a way to package it into my java application?

I've got simple java-based ppt->swf sub-project that basically works. The open source software out there, OpenOffice.org and JODConverter do the job great.
The thing is, to do this I need to install OO.o and run it in server mode. And to do that I have to install OO.o, which is allot of software (~160MB) just to convert the source PPT files to an intermediate format. Also, the public OO.o distributions are platform specific and I'd really like a single, cross platform set of files. And, I'd like to not interfer with a system's current settings, like file extension associations.
As things are now, my project is not particularly 'software distribution friendly'.
So, the questions are:
Is it possible to create a custom distribution of OpenOffice? How would one about this?
How lightweight and unobtrusive can I make the installation?
Would it be possible to have a truly cross platform distribution since there would be no OO.o UI?
Are there any licensing issues I need to be aware of? (On my list of things to check out, but if you them already then TIA!)
I have no idea to accomplish such task, but Microsoft has its PPT viewer that is for free and very small, maybe in .NET (C#) you can use some kinda function to save into a intermediate file that you need...
and by the way, how are you handling slide transictions?
I found a software that does that but you need MS PPT installed.
this was just an idea, now regarding your actually question:
you can create your own installation of OO, just jump to the Installation project and follow the lines.
I did not read 'til the end, but from the 1st paragraph it seams what you are searching for.
No, not unless you are neck deep coding in the OpenOffice project.

Resources