Improved clojurescipt repl functionality for descjop project - electron

I'm building a project based on descjop and reagent, created using the command:
lein new descjop <myproj> +reagent
The repl started by lein figwheel works ok but has very basic functionality. There is no command history, and no cursor control. Ideally I would like the full cider/nrepl/clj-refactor functionality but just some basic history and command editing would do.
Is there any easy way to improve the current repl? I have tried exploring the generated code, but I can't see how the decjop template is setting up the clojurescript repl. Any clues to how this works would be helpful.
Alternatively is there any way I can set up an alternative clojurescript repl to connect with my running electron app?

If you are on a Unix type machine then you can install rlwrap. Then instead of starting the REPL from the command line like so:
lein figwheel
Start it like this:
rlwrap lein figwheel
Then you will get history (using up and down arrows) and basic editing.

Related

Troubleshooting Lua "qdbus" command via os.execute()

I'm using ArchLinux/KDE/Plasma and I'm trying to program a lua script (as a plugin in TeamSpeak 3) that will execute the following command, which works in my terminal emulator, but not via a Lua script (that seems to be running as the same user).
The following fails:
os.execute("qdbus org.mpris.clementine /Player org.freedesktop.MediaPlayer.Pause")
I'm wondering if it's a permissions or library requirement? I know os.execute is working though, because I can run system notifications. I've tried alternative commands like machinectl, but those fail as well. I'm very new to Lua, do I need a dbus library? If so, I have no clue how to implement it.

Can we call roslaunch or rosrun through a web page?

I have a question that can we call or run files of our package inside ros through a webpage. In other word, can we perform rosrun or roslaunch from an html page?
One way to do what you want is to integrate a shell to a website. There are some projects dealing with such use cases. A greate solution is shellinabox. It is open source, easy to use and install. With the shell integrated to a website you are able to perform all shell commands you need to control ROS.
You can find a nice tutorial how to install and use shellinabox at Tecmint.

How to get color in Windows gitbash using bundle exec rake test

I am following Rails Tutorial. I am on section 3.7.1 and I am trying to get color in my gitbash command prompt when running bundle exec rake test. I have tried installing ansi, the win32console gem and the gem called turn and nothing seems to work.
Is it even possible to get red and green colors when running bundle exec rake test?
You definitely can get colored output to show up. But not with using the standard Windows cmd.exe or powershell. Gems won't help. You need to need add the ability to correctly interpret ANSI escape codes to your system -- something that cmd and powershell aren't able to do. (ANSI.sys was how ANSI escape codes were handled under DOS. cmd and powershell don't use it.)
You need to (1) install ANSICON and/or (2) install and use a different console/console emulator or shell that handles colors (ANSI escape codes).
(1) ANSICON is a program for Windows that interprets ANSI escape codes so that color is displayed. It kind of runs 'on top of' cmd or powershell. You can set it up so that it's always used whenever you use cmd or powershell, or use it only at specific times. Most people install this and are really happy with it.
Jason Karns wrote a blog post about installing and using ANSICON for git bash (on Windows) that folks have found helpful.
(2) Here are the popular options for alternatives to cmd/powershell. These are console emulators and tools and shell alternatives:
ConEmu - ("ConEmu-Maximus5") This is a console emulator, not a shell. You can use it with any shell (cmd, powershell, cygwin, bash, etc). But in day-to-day use, once you set it up, you use it just like you'd use cmd.exe or powershell, etc. (I use this so know more about it than the other choices. I have configurations for it to start up with different git/ruby version/rails version configurations as needed. I don't use ANSICON because I use ConEmu whenever I need to open up a console.)
Console 2 - Like ConEmu, this is a console emulator that adds functionality above and beyond cmd.exe (including displaying ANSI colors). You can use it with existing shells (e.g. powershell, etc.) Here's a SO answer that talks about using Console 2.
Console Z - a fork of Console 2 that is current and actively maintained. I haven't ever used it, but here is some info on how you'd configure Console Z to work with git bash.
You can also (or instead of) use a Unix-like shell (or suites):
Cygwin is the best known suite of Unix-like commands that runs in Windows. Comes with shells (e.g. MinTTY) that can be used and will work with ANSI codes
Babun A windows shell that sits on top of a cygwin install. Configurable; you can create configurations (e.g. for git bash or rvm or whatever) and share them as plug-ins. (Uses the mitty console.)
MinGW - A "Minimalist GNU for Windows" that has a GNU toolset for windows, focused on those tools needed for development. (IOW, it's a smaller and slightly different set than Cygwin provides.) DevKit, used to complie ruby gems into native windows code, uses MinGW.
MinSYS - "[A] contraction of "Minimal SYStem", is a Bourne Shell command line interpreter system. Offered as an alternative to Microsoft's cmd.exe, this provides a general purpose command line environment, which is particularly suited to use with MinGW, for porting of many Open Source applications to the MS-Windows platform; a light-weight fork of Cygwin-1.3, it includes a small selection of Unix tools, chosen to facilitate that objective." (From the MinGW site:)
Some searching might turn up additional options. These are the options most talked about and used (based on talking with others IRL, StackOverflow, and doing searching now and previously.)
Install and set one of those options (it won't take long), and then you'll be all set to see the helpful colors used by RSpec or git or whatever.

Vim - command - T

I have made the move from TextMate to VIM. I can not use macvim, policy at work does not allow me to install it. I have tried installing command-t to give me "go to file" functionality. However as I am using VIM with the osx terminal, when I press command-t it opens a new tab.
I have now decided to try FuzzyFinder but can not figure out how to search across a directory recursively for a file with it, could anyone show me how to go to a file like command-t but using FuzzyFinder. :-/
Command-T describes its intended use inside MacVim. If you want to use it inside terminal Vim, use the default binding <Leader>t (by default, <Leader> is the backslash key). You can remap this in your Vim config if you'd rather use a modifier key binding.
Fuzzy finder is not under active development. You're way better off with the awesome Command-t. The problem is terminal Vim does support it because terminal Vim needs to be built with Ruby support. It's fairly straightforward to build Vim from source to enable this.
http://brilliantcorners.org/2011/02/building-vim-on-osx-snow-leopard/
Guide for Snow Leopard but works for Lion too. You'll need to have XCode installed, not just the GCC compiler.
You could map it to ctrl or shift easily, which won't conflict with your OS like command, via:
nmap <C-t> :CommandT<CR>
# or
nmap T :CommandT<CR>
In normal fuzzyfinder to search through a directory you can use file globs, like **, e.g., at the fuzzyfinder prompt:
>File>**/yourpattern
Will search all directories under the current directory for your pattern. Just be wary not to try to do that on large filesystems, or you're going to be waiting a while and/or running out of memory. It will index the tree in memory after the first search though, and will be faster afterwards.

db:migrate fails in Emacs shell

When I rake my db in emacs, it fails– although it works fine in terminal. The error is related specifically to an environment variable that emacs doesn't seem to be picking up on. What is the best way to resolve this in .emacs? Do I need to source my profile every time I start emacs?
Which emacs shell are you using? There are a few different types which are good for different cases. I recently read this article which you may find informative: http://www.masteringemacs.org/articles/2010/11/01/running-shells-in-emacs-overview/
I suggest trying simply M-x shell which will simply run your default shell in emacs (usually bash).

Resources