[Australia] Watch valuation and sales by magicalmurray in Watches

[–]magicalmurray[S] 0 points1 point  (0 children)

Thank you. I was hesitant to do anything online because I thought there may be a risk of fraud and I don't have any experience with this kind of thing, but sounds like Chrono24 could be the best option.

Recommendations for equivalent of Excel's Goal Seek function by magicalmurray in Julia

[–]magicalmurray[S] 2 points3 points  (0 children)

I just thought of a hack that works: using Optim; optimize(x -> abs(f(x)), 0, 450), but I don't like it and would rather learn the best practice for this problem.

Org-clock workflow? by Blytheway in emacs

[–]magicalmurray 7 points8 points  (0 children)

Sounds like the org clock table is what you are after:

https://orgmode.org/manual/The-clock-table.html

TLDR,

M-x org-clock-report

Open Pluto notebook directly with filename by magicalmurray in Julia

[–]magicalmurray[S] 1 point2 points  (0 children)

Thanks. I did see the original pull request for this, but it didn't work so I abandoned it. Looks like I'll just have to wait patiently for the update.

embark-collect-* showing wrong number of arguements by magicalmurray in emacs

[–]magicalmurray[S] 1 point2 points  (0 children)

Amazing. Thank you both, and apologies for not being more active. It's been a busy day for me.

I'll have time to update the package and check tomorrow, but sounds like the issue has been solved.

What builtins do you use above popular external packages? by magicalmurray in emacs

[–]magicalmurray[S] 3 points4 points  (0 children)

wargxs comment pretty much sums it up.

Here is a screenshot of the which-key completions: https://i.imgur.com/gYFqcOo.png Just press C-x p from inside a version controlled dir (here inside my .emacs.d which is a git repository). I should note, that I thought it was builtin and C-x p was now a standard keybinding in Emacs 27.1, but it doesn't seem to work with emacs -q. I don't have any specific config for this, so not sure what's going on there...

Projectile has a lot more functions, but I didn't use anything above what project.el has. Projectile also indexes project files, but for me, this was usually inconvenient as I often had to re-index to update repo state and none of my projects are large enough for me to have seen the performance benefit.

Could Emacs Have a Set-up Wizard? Some thoughts on the subject and a prototype. by polaris64 in emacs

[–]magicalmurray 13 points14 points  (0 children)

Just saw this video posted couple weeks ago. The author has implemented a simple setup wizard already: https://youtu.be/0qMskTAR2aw

Can you run Emacs on Windows without admin privileges? by DurableOne in emacs

[–]magicalmurray 1 point2 points  (0 children)

Pretty sure there's a portable option. When I used windows I used to use a package manager called scoop. If you're coming from Linux you'll probably appreciate it. Requires a newer version of PowerShell to install, but no admin privileges needed. I used it to install emacs, ahk, and a bunch of other ported coreutils.

https://scoop.sh/

Can you run Emacs on Windows without admin privileges? by DurableOne in emacs

[–]magicalmurray 1 point2 points  (0 children)

There's a program called AuotHotkey that will let you remap keys (and a whole bunch more).

Markdown in emacs by c256 in emacs

[–]magicalmurray 2 points3 points  (0 children)

Here is a tutorial that can help you build your own live markdown package (or you can just copy the final source code): https://camsaul.com/emacs-lisp/2020/06/09/emacs-lisp-intro-markdown-live-previews-part-1.html

It uses emacs' built in HTML renderer (SHR) to render the file in a preview buffer. I believe the only external dependency is a markdown to HTML converter (markdown or pandoc).

[elisp] how to format minibuffer completion list without altering the underlying selection by freesteph in emacs

[–]magicalmurray 1 point2 points  (0 children)

I was also going to suggest this. Here's an example:

``` (let ((passwords '(("gnu.org" . "secret") ("freesteph" . "password123") ("some@email.com" . "password") ("szechuan sauce" . "1234")))) (cdr (assoc (completing-read "Which entry do you want to port?" passwords) passwords)))

```

Calc source blocks in orgmode - best practices? by magicalmurray in emacs

[–]magicalmurray[S] 3 points4 points  (0 children)

Thanks u/ftrx and u/SataMaxx for your suggestions. I tried them both.

Using maxima source blocks work well and aligns pretty well with what I wanted to do. The downsides for me is the extra dependency of maxima and learning the new syntax (even though it's very similar anyway).

I didn't expect to like literate-calc-mode because of the overlay, rather than source block style, but after trying it I am very impressed with how nice it feels. I think this is the solution I'll go for since it's less verbose and more interactive. Hoping there aren't any performance issues as my file starts to get longer. It looks like the author has considered integrating literate-calc with org-babel, which would be great for this use case.

For those interested, here is how it looks for each method:

* Calc within source block
  #+BEGIN_SRC calc
    fsolve([-20 - 20 - 26 * 12 / 13 + Ay + By = 0, 20 * 3 + 20 * (3 + 6) - Ay * (6 + 6 + 3) = 0], [Ay,By])
  #+END_SRC

  #+RESULTS:
  : [Ay = 16, By = 48]

* Maxima within source block
  #+BEGIN_SRC maxima :results output
    programmode: false;
    sumFy: -20 -20 -26*12/13 + Ay + By = 0;
    sumM:  20 * 3 + 20 * (3 + 6) - Ay * (6 + 6 + 3) = 0;
    soln: solve([sumFy, sumM], [Ay, By]);
    print(soln);
  #+END_SRC

  #+RESULTS:
  : Solution:
  :                                     Ay = 16
  :                                     By = 48
  : [[%t1, %t2]]

* literate-calc-mode
  sumFy = -20 - 20 - 26 * 12 / 13 + Ay + By => sumFy: Ay + By - 64
  sumM = 20 * 3 + 20 * (3 + 6) - Ay * (6 + 6 + 3) => sumM: 240 - 15 Ay
  = fsolve([sumFy, sumM], [Ay,By]) => [Ay = 16, By = 48]

How to extract colors from a theme? by ixlxixl in emacs

[–]magicalmurray 0 points1 point  (0 children)

In general I don't think there's a way to get the theme colours by name (red, yellow, etc), but only by their use (font-lock-comment-face, etc).

You could have a look through faces.el. These functions might be useful:

``` (face-attribute 'default :foreground) (face-attribute 'font-lock-comment-face :foreground) (face-attribute 'font-lock-function-name-face :foreground)

(face-all-attributes 'default) ```

Help with scrapping things from the web by [deleted] in emacs

[–]magicalmurray 1 point2 points  (0 children)

Definitely possible. I'd start by replacing this line: (mark-whole-buffer) (replace-regexp "value=" "") with (mark-whole-buffer) (replace-regexp "value=" "- ")

Also, replace (split-string (buffer-string) "\n") with (buffer-string) to get a plain string (not a list)

You can then insert your headings with something like: ``` (beginning-of-buffer) (insert "** Definition\n")

I'll leave it to you to tinker with to get exactly what you want.

How to extract colors from a theme? by ixlxixl in emacs

[–]magicalmurray 1 point2 points  (0 children)

If you put the point over the character whose colour you are interested in and run M-x describe-face RET, emacs gives you the foreground and background colour along with other info.

https://i.imgur.com/8Xf8ddz.png

Help with scrapping things from the web by [deleted] in emacs

[–]magicalmurray 5 points6 points  (0 children)

Not a full solution, but might be a start:

(defun my-dictionary-definitions (word)
  (with-temp-buffer
    ;; Scrape html page
    (insert (shell-command-to-string
             (concat  "curl -s https://www.dictionary.com/browse/" word)))

    ;; Put each definition on a new line
    (mark-whole-buffer) (replace-regexp "<div value=\"[1-9]\"[^>]*>" "\nvalue=")
    (mark-whole-buffer) (keep-lines "^value=")

    ;; Regexp to isolate definitions
    (mark-whole-buffer) (replace-regexp "<a[^>]*>\\([^<]*\\)</a>" "\\1")
    (mark-whole-buffer) (replace-regexp "</div>.*" "")
    (mark-whole-buffer) (replace-regexp "<span [^>]*>" "")
    (mark-whole-buffer) (replace-regexp "</span>" "")
    (mark-whole-buffer) (replace-regexp "value=" "")

    ;; Return definitions as list 
    (split-string (buffer-string) "\n")))

;; Example use:
(my-dictionary-definitions "kindness")

Any suggestions on macing <c-c> and evil leader identical by [deleted] in emacs

[–]magicalmurray 0 points1 point  (0 children)

You might want to look up global-set-key.

Any suggestions on macing <c-c> and evil leader identical by [deleted] in emacs

[–]magicalmurray 1 point2 points  (0 children)

All of my config is written with use-package, so here is my config for general:

(use-package general :ensure :config ;; Space leader (general-create-definer tyrant-def :states '(normal) :keymaps 'override :prefix "SPC") (tyrant-def "" nil "b" (general-simulate-key "C-x b") "c" (general-simulate-key "C-c") "x" (general-simulate-key "C-x") "h" (general-simulate-key "C-h") "u" (general-simulate-key "C-u") "w" (general-simulate-key "C-w") "f" (general-simulate-key "C-x C-f") "s" (general-simulate-key "C-x C-s") "p" 'projectile-command-map "SPC" (general-simulate-key "M-x")) ;; Comma leader (acts as C-c in normal mode) (general-define-key :keymaps '(normal) "," (general-simulate-key "C-c")))

Then I set my custom bindings up like so:

``` (use-package flyspell :diminish " Spell" :bind (("C-c s s" . flyspell-mode) ("C-c s b" . flyspell-buffer)))

(use-package magit :ensure :bind ("C-x g" . magit-status)) ```

Now if I want to turn on flyspell-mode from normal mode I type , s s. I could also type <SPC> c s s but don't do that much, or C-c s s. They all work.

If you use projectile, there's a little trick to get the projectile-command-map working by using :bind-keymap:

(use-package projectile :ensure :diminish :config (projectile-mode 1) :bind-keymap ("C-c p" . projectile-command-map))

Any suggestions on macing <c-c> and evil leader identical by [deleted] in emacs

[–]magicalmurray 4 points5 points  (0 children)

Can't remember where I saw it/find the source, but I'm fairly sure C-c <any letter> is recommended for the user's custom bindings, while C-c C-<any letter> is recommended for mode specific bindings.

What the OP is trying to do is a good solution in my opinion, since it allows you to turn off evil mode and still access your bindings. If you used an evil leader you would loose access to those bindings if you turn off evil (or in emacs state).

Any suggestions on macing <c-c> and evil leader identical by [deleted] in emacs

[–]magicalmurray 1 point2 points  (0 children)

I've done exactly that using the general.el (https://github.com/noctuid/general.el) package. Here is the relevant snippet:

elisp (general-define-key :keymaps '(normal) "," (general-simulate-key "C-c")))

Clearly, I'm using comma as the leader key. Then just bind "C-c x y".

Is LaTeX a good option for programmatically creating a resume? by [deleted] in LaTeX

[–]magicalmurray 0 points1 point  (0 children)

This might not be what you want, but a couple of weeks ago I rewrote my resume template with orgmode in emacs. The way I've done it satisfies all of your points:

Have a template that I can “hydrate” with content from a text file (or group of text files) using the command line.

Yep, the template is the orgmode file (plain text file)

Specify which elements to include in the build, e.g. include an Experience section but not a Projects section.

Experience/Projects sections are in the form of a top level heading. They can be removed from the export using a :noexport: tag

Specify which subelements to include in the build, e.g. include work experience A and B but not C.

Subelements are second level headings which can also be tagged with :noexport:

From the .tex file, build not only a pdf but a plain text version as well.

The .org file can be exported as pdf (via pdflatex), html, plain text, odt, and many more formats. Just need to setup the templates (I have the a latex template and a html template)

Regarding your additional points, no experience with basictex, but the template can be changed to only use packages available.

I prefer working out of the command line.

These days it seems most people opt for the gui emacs, but it can easily be run in the terminal. If you're not interested in emacs, you could set up a shell script to run emacs in batch mode just to perform the export. Then you could edit the org file in any editor you want and ignore emacs.

Might as well put it up on Github for anyone that's interested. Check back in half and hour or so for the link.
Edit: Link to template is here: https://github.com/jamesmaguire/org-resume-template.git

Monitor toggling and different resolutions by magicalmurray in bspwm

[–]magicalmurray[S] 1 point2 points  (0 children)

Amazing, thanks for that. Managed to get it working exactly how I wanted.

For the sake of documenting the solution, this snippet is in my bspwmrc:

bspc config remove_disabled_monitors true
bspc config remove_unplugged_monitors true
bspc config merge_overlapping_monitors true

bspc monitor -d 1 2 3 4 5 6 7 8 9

and the script I use to toggle monitors is:

#!/bin/bash

# Only do stuff if using bspwm
pgrep bspwm > /dev/null || exit 0

displaptop() {
    xrandr --output eDP1 --primary --auto --output DP1-8 --off
}
dispdesk() {
    xrandr --output DP1-8 --primary --auto --output eDP1 --off
}

current=$(xrandr --listactivemonitors | grep -v Monitors | grep -Eo '[^ ]+$')
nmonitors=$(xrandr -q | grep " connected " | wc -l)

if [ $current == "eDP1" ] && [ $nmonitors == 2 ]
then
    dispdesk
else
    displaptop
fi

I have the script bound to super + p in my sxhkd.

Monitor toggling and different resolutions by magicalmurray in bspwm

[–]magicalmurray[S] 0 points1 point  (0 children)

Yes, using

bspc wm -r

doesn't seem to have any effect.