Posts

Showing posts from July, 2022

GNU Emacs for Kids: Matching game

Image
  Build learning exercises for kids using GNU Emacs. The game basically builds up a grid of file names (without the extension) and images. So you can create separate folders for different activities e.g. for colors, shapes, body parts, relationships etc. It randomizes the sequence each time which encourages the kid to learn the relationship instead of the pattern. - M-x game-match If you're running for the first time, it will ask you for a directory of images. You can re-run the same exercise till the kid gets it right. To change the activity, run the command with a prefix. - Use click and drag to draw joining lines. - Use u for undo and q or RET for quit. Code https://gitlab.com/atamariya/emacs/-/blob/dev/lisp/svg.el https://gitlab.com/atamariya/emacs/-/blob/dev/lisp/play/game-match.el    

Interactive XPath and JSON Path Builder in GNU Emacs

Image
  Build XPath and JSON path interactively in GNU Emacs. XPath parsing uses xmllint (part of libxml2-utils package in Debian). For JSON, no external tool is used. The code exposes two APIs: - M-x xpath-builder and M-x json-path-builder for interactive usage - (xpath-resolve xpath) and (json-resolve json-path) for programmatic usage Code https://gitlab.com/atamariya/emacs/-/blob/dev/lisp/xml/xpath.el   Screenshots Xpath JSON Path

Swipe for Text Input in GNU Emacs

Image
  Swipe on an on-screen keyboard for text input in GNU Emacs.  (require 'sweep)   ;; Ensure variable points to the location of keyboard.svg file  (setq sweep--keyboard (concat data-directory "/images/keyboard.svg"))   - Execute M-x sweep-mode .   Code: https://gitlab.com/atamariya/emacs/-/blob/dev/lisp/svg.el https://gitlab.com/atamariya/emacs/-/blob/dev/lisp/sweep.el https://gitlab.com/atamariya/emacs/-/blob/dev/etc/images/keyboard.svg  

Chronicles of Emacs : The Editor and the T-shirt

Image
T-shirt pattern   You can generate a preliminary pattern based on your measurements for a custom fit T-shirt using GNU Emacs. This will generate an SVG image which you can print and use for tailoring. Don't forget to add allowance for seams. - Set your measurements in tailor.el   (defun tailor--bust (svg)   (let* ((cmds nil)          (body-length    72)          (chest          56)          (waist          56)          (shoulder       48)          (sleeve-length  21)          (arm-hole       26.5)          (neck-back      5)          (neck-front     10)          (neck-opening   17)          (sleeve-opening 19) - Evaluate buffer using menu or M-x eval-buffer . - Execute M-x tailor to generate the SVG.   Code: https://gitlab.com/atamariya/emacs/-/blob/dev/lisp/svg.el https://gitlab.com/atamariya/emacs/-/blob/dev/lisp/tailor.el    

Screen mirroring using GNU Emacs

Image
Screen mirroring using GNU Emacs from Debian XFCE to LG UJ632T   Note: Don't forget to quit properly (or use wpa_cli p2p_cancel ). Else your computer will continue to scan for peers in the background. Config (require 'tv) (setq wfd-wpa-cli " /usr/sbin/wpa_cli ")   Code https://gitlab.com/atamariya/emacs/-/blob/dev/lisp/tv.el https://gitlab.com/atamariya/hostap/-/blob/tools/wpaspy/wfd.py (RTSP server)   Setup We need to be able to run wpa_cli and nmcli as a normal user. Hence we will add the user and the tools to netdev group.   - Edit /usr/lib/systemd/system/wpa_supplicant.service (as root) ExecStart=/sbin/wpa_supplicant -u -s -O /run/wpa_supplicant -G netdev   - Restart wpa_supplicant (as root). systemctl daemon-reload service wpa_supplicant restart    - Modify user group, file permissions and path. sudo adduser <username> netdev chown -R :netdev /usr/sbin/wpa_cli /var/run/wpa_supplicant/* export PATH=/usr/sbin:$PATH    - Start the RTSP server. python3 wfd