@chmouel@fosstodon.org
@chmouel@fosstodon.org avatar

chmouel

@chmouel@fosstodon.org

mostly #emacs, #linux, #commandline TIL and #programming snippets - 🇫🇷 🇮🇱

This profile is from a federated server and may be incomplete. Browse more on the original instance.

chmouel, to Bash
@chmouel@fosstodon.org avatar

reading the tzselect shell script from the tzdata, there is a nice flag called -c to specify coordinates, the way the script does gps coordinates to timezones in awk is pretty impressive!

so if you travel a lot and have no idea where you are located and want to set your timezone quite easily you can do something like this to approximately know where you are (it's useless i know, just interesting):

tzselect -c $(curl -s ipinfo.io|jq -r .loc| tr , -)

chmouel, to Bash
@chmouel@fosstodon.org avatar

Something that served me well over the year, viewing a configuration files without the comment and the newlines with sed:

sed -e '/^#/d' -e '/^$/d' file.conf

so you can see a clean version of all the settings you have set in the file..

brab, to emacs French
@brab@framapiaf.org avatar

J’ai beau faire ça depuis des années, j’ai toujours beaucoup de plaisir à envoyer un mini-correctif de quelques lignes à un projet libre

https://github.com/protesilaos/denote/pull/268

(Sinon pour c’est bon, mangez-en)

chmouel,
@chmouel@fosstodon.org avatar

@brab ça a pris 7 mn à prot pour merge t'as PR, cest sure que c'est plus satisfaisant à contribué à un projet quand on as un feedback aussi rapide

chmouel, to emacs
@chmouel@fosstodon.org avatar

I have blogged about isearch mode and how i am using it for advanced search management: https://blog.chmouel.com/posts/emacs-isearch/

chmouel, to golang
@chmouel@fosstodon.org avatar

I finally found time to setup dape.el properly to debug my tests https://github.com/svaante/dape/blob/master/dape.el

dape is an alternative Debugger adapter protocol for emacs, that keeps it simple and close to emacs (and compatible with eglot)

my config is available here: https://gitlab.com/chmouel/emacs-config/blob/main/lisp/init-go.el#L54

chmouel, to python
@chmouel@fosstodon.org avatar

A small function to search or code on

(defun my-github-search(&optional search)
(interactive (list (read-string "Search: " (thing-at-point 'symbol))))
(let* ((language (cond ((eq major-mode 'python-mode) "Python")
((eq major-mode 'emacs-lisp-mode) "Emacs Lisp")
(t "Text")))
(url (format "https://github.com/search/?q="%s"+language:"%s"&type=Code" (url-hexify-string search) language)))
(browse-url url)))

chmouel,
@chmouel@fosstodon.org avatar

I shortened the code for brievety but you get the full function and all mode here https://gitlab.com/chmouel/emacs-config/blob/main/lisp/init-functions.el#L207

chmouel,
@chmouel@fosstodon.org avatar

@mykhaylo yeah i thought the github syntax would have been more than that but yeah i can just fallback on using the mode-name directly and only change for sh... thanks (and tbh that huge cond was generated by AI)

chmouel, to emacs
@chmouel@fosstodon.org avatar

Decided to install to edit my org file and access for remote org editing and it works pretty well so far (altho I needed to update the emacs version to latest in the image)...

I have pre installed in the container the vim and org extensions for keybinding and highlighting but mostly use the integrated terminal

chmouel,
@chmouel@fosstodon.org avatar

@mykhaylo I don't use org-agenda, but it's a real emacs in the vscode terminal at the bottom screen so any emacs/org running in non gui (which mean almost everything) works... Nerd/FA icons does not work atm but i think that should be a matter to figure it out how to have a remote web font loaded on vscode web

chmouel, to random
@chmouel@fosstodon.org avatar

It took me a while to figure this one, out, i wanted a way to cycle over every windows for the current workspace no matter on which container they are in

because sometime i split horizontally and sometime vertically, I don't want to remember to go down or up so then here is the script:

https://gitlab.com/chmouel/chmouzies/-/blob/main/graphical/sway-prev-next-win?ref_type=heads#L2

chmouel, to running
@chmouel@fosstodon.org avatar

Trail Running by Nice in november 😎 ☀️

image/jpeg
image/jpeg
image/jpeg

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • kavyap
  • DreamBathrooms
  • osvaldo12
  • magazineikmin
  • khanakhh
  • tacticalgear
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • ethstaker
  • Durango
  • normalnudes
  • provamag3
  • ngwrru68w68
  • InstantRegret
  • cubers
  • modclub
  • everett
  • thenastyranch
  • cisconetworking
  • Leos
  • GTA5RPClips
  • tester
  • vwfavf
  • anitta
  • JUstTest
  • All magazines