How can I install mindmup as a standalone application using sinatra. Is there any proper documentation for that. I don't have experience with ruby. Please help.
The source code is available here
Note: this is a lazy hack, not the official way, etc...
Didn't work for me either. First it complained about $ which is just jquery, so i copied and pasted jquery into public/mm.js at the end. that solved that (not ideal, but who cares - technically, you should add another script dependency, etc...)
next, it tries to get external.js and external.css from static.mindmap.net which fails. All I did for this is simply look in mindmup.com with the google F12 thing, then find the external.css and external.js in the sources :) just dump these where the mm.js is.
It seems like the web.rb has the following
public_host = ENV['PUBLIC_HOST'] || 'http://static.mindmup.net'
so that's what was mucking everything up... change that to localhost:5000 and don't forget to get rid of the timestamp variable:
static_ts = '20150106142106'
turn into
static_ts = ''
Now it complains about portrait.png, some font awsome stuff etc... so we have to throw that in too.
and after all that, you still get an error, which really sucks...
so the code it's complaining in is actually the MM.main function! Which i assume is the primary function! It's some jquery thing where context is undefined... no clue how to go from here...
Related
So I started working on my first open-source contribution in ruby. There I have the library I'm working on in the /lib/ folder. Now when I tried changing the code, my program (which uses the library) still uses the old code.
For example: Broke a function on purpose by deleting its end keyword (which should be causing an immediate crash), but it kept working perfectly after I did.
Another example was changing the code in such a way it should still work (mutating the output string) but it still returned the old string.
user~$ bin/ruby-hyphen -V "this is a test sentence"
this is a test sen-tence
Does anyone know if I have to tell the runtime to refresh it or something along those lines?
I found out why that happened. The file has a *.gemspec, which made it act as if it was a gem. To see the changes I needed to enter:
gem build *.gemspec
bundle exec rake install
Or, if you want to develop quicker: change everywhere you require it into a require_relative. That should also fix it. I hope this question helps someone in the future!
this is kind of a specific question but I am wondering if someone of you came across the same problem before.
What I am trying to do:
I am working on a jtl plugin.
To start off, the plugin should just run over the payments (the specific hook is active an works) and rename the description. Since I need to add more functionality later, all the stuff has to happen in the plugin (even though jquery would be easier for the former case).
In the shop system, the payments are set like this:
$smarty->assign('Zahlarten', $zahlarten);
In the plugin, I get all the payments like this:
$tmpPayments = $smarty->get_template_vars('Zahlarten');
I then loop over the array, doing specific changes. In the end, I want to add the payments back like:
$smarty->assign('Zahlarten', $tmpPayments');
And this is, what does not work. When I change the description and watch the variables in the phpstorm debugger, they are updated accordingly.
But after the page is loaded completely, the changes are not visible.
I know professional plugins that do it the exact way, and it works.
Changing the original array also does not help.
Also, deactivation caching does not work. Like this:
$smarty->assign('Zahlarten', $tmpPayments', true);
What works is:
$smarty->assign('Zahlarten_tmp', $tmpPayments');
But thats obviously not what I want, since I would have to change the template for that.
To wrap it up, it seams to me that there is some kind of caching going on which I can not figure out.
Does anyone has an idea or can point me to sources that might help?
Thanks in advance!
I finally came across the answer (hours later :P).
Root of the problem:
Some system source code far away from my actual context made its own calculations, leading to another
$smarty->assign('Zahlarten', $farAwayCalcs);
,thus overriding my changes.
Never underestimate stepping through the code with your favorite debugger. ;)
Cheers!
As I am learning Elixir/Phoenix, I happen to run into an issue like this often.
The problem is that this comes from a dependency, so normally I do this:
open deps/something/.../thefile.ex
add some debug code like IO.inspect to see what params are being passed
stop server, recompile with mix deps.recompile something
check the documentation to see what types are expected to that function
compare the types and trace down the problem to my code
This works but I'd like to improve my process, I know I can use Iex to start a repl, but I'd like to get much faster in terms of:
having a repl inside of the error page itself started automatically (like in better_errors gem for Rails)
having a way to see what arguments went into that method without me digging around (could be solved by the former point)
being able to see a method's documentation quickly
Also any other tips are greatly appreciated.
Please open up an issue in Plug: https://github.com/elixir-lang/plug
You have some great suggestions, like accessing the docs and make the arguments explicit. I don't think we can provide a REPL at the place of error though.
EDIT 1: I went ahead and opened an issue here since I got excited about those improvements! :D
EDIT 2: I realize that I should probably have used a comment as this is not quite an answer (yet!)
I can't get rspec to work. I did the first level on codeschool, only i followed on my own computer, and it worked fine (had to change should with expect). But now it suddenly stopped doin it thing.
I'm not sure if I did anything to make this happen.
I know this probobly isn't sufficient to figure out whats wrong, but do anyone have a clue, or know where I can fix this.
I'm a novice in this so go easy.
Thanks.
Rspec is telling you that it can't find the specification file you're trying to run. Can you confirm that calc_spec.rb exists in the folder c:/King Kong/Desktop/the_odin_project/rspec?
(Please include code/output samples as text, not images, for ease of reference.)
(this is on a OSX latest 10.9.x)
Some of the shortcuts work with the tab, others not..
for example:
.class>ul>li*5>a
when tabbing gives
.class>ul>li*5>
while
div.class
gives correctly
<div class="class"></div>
Also html:5, input:radio expansion doesn't work (only on CTRL+E).
Should I look my key mappings? Could something from OSX be interfering? (I use OPTION+TAB to switch windows with the help of Karabiner...
Glad that helped.
Rather than looking at all plugins installed, you may want to first try entering sublime.log_commands(True) in the ST console. Then try inserting as normal. If it's another ST plugin performing an action, the command name will be listed. If you don't recognize the name of the command, you can use something like FindKeyConflicts to see what package it's associated with. The above is a plugin I wrote, but I'm sure there are other plugins that do the same thing. In most cases, the name of the command is enough to find the offending plugin.
Also adding your solution here to make it a bit more clear.
I found my answer there: https://github.com/sergeche/emmet-sublime/issues/363. Conflict with ST's autocomplete. Commented it out, and we're good. I guess now I'm missing some out of the box snippets but well.
If you would like to see the default snippets, without having to search/extract them manually, you can try using https://sublime.wbond.net/packages/PackageResourceViewer. Another plugin I wrote to help with viewing those packaged files/plugins.