Yesterday I discovered that there's a much more simple way to unclutter your screen making the cursor invisible.
(setq make-pointer-invisible t)Voilà, that's it.
Technical stuff, mostly
(setq make-pointer-invisible t)Voilà, that's it.
[ /tmp ] %mkdir test [ /tmp ] %cd test [ /tmp/test ] %ls [ /tmp/test ] %mkdir foo [ /tmp/test ] %echo OHAI >foo/bar [ /tmp/test ] %cd foo [ /tmp/test/foo ] %ls bar In another terminal [ ~ ] %cd /tmp/test [ /tmp/test ] %ls foo [ /tmp/test ] %mv foo bar [ /tmp/test ] %ls bar bar [ /tmp/test/foo ] % ls bar [ /tmp/test/foo ] %pwd /tmp/test/barIs there a reason for that?
function memoize(func) return setmetatable({}, { __index = function(self, k) local v = func(k); self[k] = v; return v end, __call = function(self, k) return self[k] end }) end
git branch --contains [treeish]
git branch -a --contains [treeish]
[m] ok [m] and do you thing relative time is more useful then absolute one? [m] or vice versa? [m] the other one will be on tooltip [rgrau] day/time for me is the most valuable [rgrau] batch processes are at 4:00 [k] I think relative time is more useful if it refreshes automatically [rgrau] not 8 hours ago [k] like, each 10 seconds [m] it refreshes automatically [k] then yes [rgrau] but you loose track [rgrau] because you have to synch every time [m] for me relative is for quick check [m] absolute for serious things [rgrau] at any scale, I know where am I [rgrau] (tm) [m] :D [m] pfff [m] because it is not 'ago' [rgrau] absolute time is the way [rgrau] if it's shorter [rgrau] (tm) [rgrau] in the app logs, if you have to compare , there's absolute date [rgrau] and absolute dates do not rely in the global state of the world [rgrau] it's immutable [rgrau] so better [rgrau] (and I mean it (tm))What's your take?
(url-retrieve "http://localhost:7070/api/services" (lambda (s) (switch-to-buffer (current-buffer))))
local _ , resource = unpack(require 'controller_helpers')
git push origin local_branch:remote_branch
lua_package_path ";;$prefix/?.lua;";
local f = function() local c = false return function() c = not c return c end end local l = f()
(require 'ox-reveal) (setq org-reveal-root "reveal.js")
(setq orgstruct-heading-prefix-regexp "^;; ")
Lately I've spent a quite few hours hacking on Lua. I love its simplicity, and the way it exposes lots of inner aspects of the programming language, that are usually hidden from the user in other programming languages.
One of the cool aspects of lua is the easiness of embedding it into your C app. But let's make it more fun. Embed Guile also inthere.
The process to embed Lua in a C app is quite easy, and simple (for really simple things), but I guess it gets more cumbersome when the complexity of the embedding system increases. Being a stack based vm makes it non-trivial to write some embedding functions (recursive functions, for example).
The way to embed guile into an app is also, really easy. And Powerful. And you're not bound to interact with it using a stack based machine, but you just register your functions, and use the generic SCM type for all inputs and outputs. I find it easier than Lua
Here's a minimal example that does some trivial calculations and the flux of the code passes from C to guile, guile calls another C function, and after this, we call lua which also calls a function we have defined in C. In the end it's doing something like (n! + 1).
(defun shell-execute () (interactive) (let ((file-buffer (or (buffer-file-name) "")) (command (read-shell-command "Shell command: " nil nil nil))) (shell-command (replace-regexp-in-string "%" file-buffer command)))) (global-set-key (kbd "M-!") 'shell-execute)
Some deprecated features have been used. Set the environment variable GUILE_WARN_DEPRECATED to "detailed" and rerun the program to get more information. Set it to "no" to suppress this message.Nice, no? Let's set the variable and rerun.
`scm_int2num' is deprecated. Use scm_from_int instead. `scm_num2int' is deprecated. Use scm_to_int instead.These kind of things make usin guile a pleasure. Now back to embedding.
(defun rgc-show-ruby-tags () (interactive) (occur "^\\s-*\\\(class \\\|module \\\|def \\\|[^:]include \\\|private\\b\\\|protected\\b\\\)")) (define-key ruby-mode-map (kbd "C-c t") 'rgc-show-ruby-tags)
unmanage stalonetray exec Downloads/stalonetray-0.8.1/src/stalonetray exec nm-applet
# -*- run-command: "/opt/openresty/nginx/sbin/nginx -c /home/rgrau/workspace/nginx-translator/config_nginx.conf -p /tmp/nginx/ -s reload"; -*
(defun rgc/run-command () (interactive) (when (boundp 'run-command) (shell-command run-command))) (add-to-list 'after-save-hook 'rgc/run-command)To speed up the 3rd step, you can play with tailing the log file in a shell-mode buffer, or use auto-reverse-tail-mode. But let's leave it for another post :) Btw, Next weekend I'll be the next FOSDEM. If anyone wants to meet and hack some elisp or discuss vim vs emacs with a beer, ping me (raimonster at gmail dot com)
(defun fetch-defuns (buffer) (interactive) (save-excursion (goto-char (point-min)) (let (sexp (defuns nil) (defmacros nil)) (condition-case nil (while t (setq sexp (read buffer)) (when (listp sexp) (case (car sexp) (defun (push (cons (cadr sexp) (doc-if-any sexp)) defuns)) (defmacro (push (cons (cadr sexp) (doc-if-any sexp)) defmacros))))) (error nil)) (generate-docs defuns)))) (defun doc-if-any (sexp) "search for the doc" (when (stringp (cadddr sexp)) (cadddr sexp))) (defun generate-docs (defuns) "generate a simple org with the docs" (mapconcat (lambda (x) (format "* %s %s" (car x) (or (cdr x) "-undocumented-"))) defuns "\n\n"))