1. Emacs: replace tabs with spaces


    When you want to replace tab with spaces or vice versa don't use M-% (query-replace) but M-x tabify or M-x untabify. They work on the current selection so if you want it to be applied to a whole buffer, try C-x h (mark-whole-buffer) before to select the whole buffer.

    read more
  2. Searching and replacing in emacs


    Day two of my serie about emacs, about searching and replacing.

    • Function name: isearch-forward
    • Typical Key binding: C-s
    • How to get help: C-h f isearch-forward

    isearch-forward let you type a string to be searched incrementally in the current buffer, successive following C-s will jump to the next match.

    • Function name …
    read more
  3. Numeric arguments in emacs


    I'm starting an 'emacs trick of the day' sequence with:

    • Function name: universal-argument
    • Typical Key binding: C-u
    • How to get help: C-h f universal-argument
    • Usage: C-u

    Receive a numeric argument that is given to the next called function, when no numeric argument is typed, the value defaults to 4. So …

    read more
  4. nfsmount: rpc failed: 2


    For those, here on the internet, asking themselves what is this fscking rpc failed: 2 while mounting an NFS, it's possible that the response is here: Your NFS client trying to mount the NFS share will use RPC to communicate with the serveur, il will go like:

    > PORTMAP GETPORT(Program …
    read more
  5. Python: Introducing ppipe : Parallel Pipe


    /!\ this was highly experimental code written in 2011. Today you should NOT use it, just look at it if the subject amuses you. Better take a look at asyncio if you want this kind of tools.

    I'll speak about my pipe python module so if you didn't know it, you …

    read more
  6. [Bashism] How to generate random number without $RANDOM ?


    There is a common bashism, that is to use $RANDOM. Typically you'll have to remove bashism while rewriting your scripts for dash or sh. There is a lot of solutions to generate random numbers in many different ways, but I'm not here to pollute the internet demonstrating 42 differents ways …

    read more
  7. Pipe: Infix syntax for Python


    Pipe is a Python module enabling infix syntax in Python. For those asking "Why ?" let's take an example: Compare the readability of the classical prefix syntax:

    sum(select(where(take_while(fib(), lambda x: x < 1000000) lambda x: x % 2), lambda x: x * x))
    

    And the infix syntax:

    fib() | take_while(lambda …
    read more

« Page 2 / 4 »