how to add to PATH variable in OSX - macos

I'm going to try building a custom language extension for Komodo Edit.
In order to build an xpi file, I need to add something to the PATH variable.
I'm not really familiar with the command line, so I'm not 100% sure how to do this.
I started by created an empty .profile file in my user directory.
Can I add modify that in a text editor to do what I need to do?
Here's the instructions I'm trying to follow.
http://community.activestate.com/forum/introduction-building-komodo-extension
Here is how packing up the Mako UDL into a Komodo extension works. Komodo includes a SDK in its install tree. On Linux and Windows this is found at "installdir/lib/sdk", and for a Mac it's found at "komodo.app/Contents/SharedSupport/sdk". That SDK includes a koext helper tool in the /lib/sdk/bin directory:
Put the SDK bin dir on your PATH and you should be able to run koext at the command line. Similar to tools like cvs or svn, these are tools with multiple sub-commands.

Something like that should be helpful
http://www.tech-recipes.com/rx/2621/os_x_change_path_environment_variable/
export PATH=/ANYTHING_YOU_ARE_WORKIN_ON/bin:/opt/local/bin:/opt/local/sbin:$PATH export

Related

Is there a quick way to enable install tool in TYPO3?

Is there a quick way to enable install tool in TYPO3?
Please share a command for Windows. The one I have access to is for Linux I think.
I am using Windows and need to enable install tool to access TYPO3 panel..
you need to create a file ENABLE_INSTALL_TOOL in the typo3conf/ folder of your webspace. the content doesn't matter. it does not need to be an empty file.
you have multiple options:
create a new file with the windows file explorer. make sure you have no file extension!
use a shell/commandline: echo anything > ENABLE_INSTALL_TOOL while in the apropriate path
use any programm to store files. make sure to remove any file extension.
Maybe this can help you to "touch" the Install Tool file ENABLE_INSTALL_TOOL: Windows equivalent of 'touch' (i.e. the node.js way to create an index.html)

pycharm swig how to? [windows]

I would require some guidance in regards to installing a module/package in pycharm (free edition). I have to mention that i have not worked with this IDE yet and wanted to try it out on a little project containing smartcards.
When i try to install "pyscard" i get the error that boils down to
error: command 'swig.exe' failed: No such file or directory
People say just install SWIG, which i guessed already ^^.
The issue i have is that i actually have no idea how to... and none of the pages i found has really enlightended me on this issue.
I downloaded the zip "swigwin-3.0.12" but i am at a loss what to do with it now. EDIT: According to the SWIG page this is an already compiled version and i have to somehow make pycharm recognize that the folder it is in contains the swig.exe it requires.
EDIT2: Adding the folder containing the swig.exe to the PATH variable also did not work ... which i thought would be the issue
EDIT3+Answer:
Ok the link in the comments from "wp78de" was correct my problem was that pycharm/pc restart were needed for it to catch the added PATH variable to the swig.exe (for pycharm that is)
Any advice is appriciated.
Envoirment:
Windows 8.1 Pro 64-bit
Pycharm 2017.2.4
Python 3.6
Basically, you just have to add the directory that contains the swig executable the PATH environment variable. You can do it via CMD or the Windows UI.
If you have added swig to your path, you should be able to call it in the command prompt from any directory: open "cmd", and type swig --help" on that prompt.
A restart of PyCharm (or whatever your IDE is) and Windows might be required.

How to applying clang-format to all project files at once in Xcode for Objective C?

I have installed clang-format by cloning https://github.com/travisjeffery/ClangFormat-Xcode.git.
This works fine for applying clang-format for selected files. But I wanted to know if there is some other approach (any command line option) to apply for all files at once.
To use the command line
You need to download clang-format for MacOS and use that tool from within Terminal.app.
How to get the binaries and setup
The following stackoverflow answer discusses using Homebrew to get the MacOS binaries: Where are clang-format and clang-format.py in Mac OS X with Xcode Command Line Tools installed?
I followed the instructions on https://nacho4d-nacho4d.blogspot.de/2013/11/clang-format.html to:
Download clang binaries for MacOS
Move un-tarred files to ~/Development/Tools/clang+llvm-3.9.0-x86_64-apple-darwin folder
Create an alias in .bash_login named cformat
I prefer downloading files over using Homebrew, but you can choose whatever method you want.
If you choose to download the clang binaries yourself, you may want to use a bash alias over adding the clang binaries path to the PATH variable, in case of a binary name collision.
To add the bash alias, open .bash_login in your favorite text editor and add the following line:
alias cformat=~/Development/Tools/clang+llvm-3.9.0-x86_64-apple-darwin/bin/clang-format
You would change the path to wherever you place the clang binaries.
To format all files within a project folder
From within Terminal.app, cd to the source directory you want to format and type cformat *.m ; you can use whatever wildcard you want; clang-format will output the changes it will make to the window. If you are satisfied with the results and want clang-format to change the files for you, type cformat -i *.m and all of the Objective-C files within that folder will be formatted for you.
Settings for clang-format
The clang-format tool will look for a file named .clang-format in the immediate directory you are in and walk up to see if it can find one to know what settings it should use.
You can experiment with different settings by placing your preferences in a .clang-format file (I placed mine in my home directory) and you can look at the different clang-format styles by typing cformat -style=llvm -dump-config > ~/.clang-format in Terminal.app.
The styles that come with clang-format include "LLVM, Google, Chromium, Mozilla, WebKit".

Using Google's ProtoBuf (and a .proto file) to create a Python API Library

I have the .proto file used in the open-source Android API (http://code.google.com/p/android-market-api/), and am having some trouble compiling the file to generate the .py.
I'm trying to follow the instructions here, https://developers.google.com/protocol-buffers/docs/pythontutorial , and am on the steps that are under the header "Compiling Your Protocol Buffers".
I've downloaded the compiler, protoc.exe. The readme says "To install, simply place this binary somewhere in your PATH," which I'm not understanding. I'm messed around with it for a while now, but can't think of how to proceed.
I'm quite the novice programmer, so please tell me if something isn't clear, or if I'm having some sort of fundamental misunderstanding... about anything. I'm on Windows 7 by the way.
Thanks!
if protoc.exe is not in the same directory you're calling it from, you need to add it to your PATH environment variable to be accessible from the calling directory when you're in the shell. open up a command shell and execute:
set PATH=%PATH%c:\directory\to\proto\executable;
then change directories over to where your source code is and execute the compilation line as instructed from the google page.
I had the same problem because it is not written that clear in the README.txt. What they mean is to:
1. take the protoc.exe and put it in the same folder with the other files of your project.
2. open the cmd to that directory and run: protoc --cpp_out=. myfile.proto
=> This will create the 2 new files in the folder with the files of your project, and then you can add them normally to your program.
This helped me: http://www.scriptol.com/programming/protocol-buffers-tutorial.php
This is for c++, but I guess it will be something similar for python; I guess you just have to change the command you are using in the cmd :)

How can I test my vim plugin?

Hi guys : I recently (accidentally) removed all folders/files from my .vim folder in mac os x (home directory).
I am trying to add in the Clojure Vim plugin (VimClojure) - its simply a folder which you are supposed to "drop into .vim/plugins".
I have added it, but I don't see any changes to the syntax highlighting when I launch vim. I'm not sure wether vim "sees" the plugin or not.
I'm on OS X .
Any ideas on how to debug the plugin ? In particular
1) How does VIM look for plugins ?
2) Are there files which need to be in $HOME/.vim/ ?
3) Is it sufficient to simply dump the unzip a new plugin file into $HOME/.vim/plugins when installing a standard vim plugin ?
Thanks
About debugging: in order to see whether vim has loaded your plugin you can use :scriptnames and also breakadd file /path/to/your/plugin (or breakadd file *your_plugin_name.vim: I never used absolute paths so I do not know what breakadd will do in this case). Other questions:
Described in :h initialization, precisely :h load-plugins.
Vim does not need any files at all (except vim executable, used shared libraries, dynamic linker and the kernel of course).
Follow installation instructions. Normally plugins are either extracted to ~/.vim or distributed as a singe file that should go to either ~/.vim/plugin (no s!), ~/.vim/colors, ~/.vim/ftplugin or such. I guess you should try to extract it to ~/.vim/plugin, but if archive contains some special directories like plugin/, ftplugin/, colors/, after/ (see /usr/share/vim/vim73 for a list) it is likely that it should go to ~/.vim. Also consider using vim-addon-manager, if plugin was posted on vim.org VAM is likely to be able to install it.
A few points.
How does vim look for plugins? See :help startup so see where and when vim looks for files to load.
Not really. Anything there is just personal customization. Vim will run fine without a .vim folder.
That all depends on the plugin. It sounds to me like the VimClojure plugin may be a little misleading. Do you have a link to the source you are using?
In any case, the first step I always take when attempting to debug a script is check the output of :scriptnames. This command will show you what scripts vim has loaded for the current session. If you see none of the files shipped with VimClojure, you probably made a mistake during the installation.
Another tip is that you really should look in to using a plugin manager such as vundle or vim-addon-manager, or at least the runtimepath manager pathogen. This seems to be the way of the future for vim configuration these days and it makes installing and managing plugins much easier. They also help to keep your .vim folder clean and organized.
The VimClojure directory should either be extraction on top of your .vim folder, or in a bundle folder if your using something like pathogen (which you should!). If you're starting from scratch, consider starting with vimclojure-easy (not to toot my own horn) which is a basic, full install of VimClojure with instructions.

Resources