Updates from Dimitris Kalopsikakis Toggle Comment Threads | Keyboard Shortcuts

  • Dimitris Kalopsikakis 07:35 on 21 January 2018 Permalink | Reply
    Tags:   

    Emacs Macros 

    Create macro:

    • C-x ( start recording macro
    • C-x ) stop recording macro

    Executing macro:

    • C-x e
    • C-u 37 C-x e  execute macro 37 times

    Name macro:

    • M-x name-last-kbd-macro

    Export macro to buffer:

    • M-x insert-kbd-macro

    Reference:

     
  • Dimitris Kalopsikakis 08:11 on 10 December 2017 Permalink | Reply
    Tags: http server,   

    Run a one-line http server for trivial tasks (python) 


    Reference:

     
  • Dimitris Kalopsikakis 08:04 on 10 December 2017 Permalink | Reply
    Tags: , , venv, virtual environment   

    Simple script to create a python virtual environment 

    Before running the script, do:

    The script downloads python, compiles it, installs it in $PYINSTALL  and creates  virtual environment in $PYENV :


    Reference:

     
  • Dimitris Kalopsikakis 16:53 on 1 May 2017 Permalink | Reply
    Tags: , org, org mode   

    Emacs org-mode: convert plain list to headings 

    In order to convert the entire plain list to a heading subtree:

    In order to convert a plain list item to  headline:


    Reference:

     
  • Dimitris Kalopsikakis 08:24 on 28 March 2017 Permalink | Reply
    Tags: fileinput, filter, , ,   

    Inplace filtering with python 

    This redirects standard output to the file that is being read and overwrites each line, inplace:

    usage example : ./test.py *html


    Reference:

     
  • Dimitris Kalopsikakis 20:30 on 7 March 2017 Permalink | Reply
    Tags: , , perl   

    Edit multiple files at once (perl is not yet dead) 

    perl -pi.bak -e 's/<REGEX>/<REGEX>/g' <FILES>


    Reference:

     
  • Dimitris Kalopsikakis 16:32 on 2 March 2017 Permalink | Reply
    Tags: ,   

    ssh doesn’t display (remote) UTF correctly 

    When you ssh to a remote host and greek characters (or other utf characters) do not display correctly, try to comment out at /etc/ssh/ssh_confg the line

     


    Reference:

     
  • Dimitris Kalopsikakis 12:19 on 5 December 2016 Permalink | Reply
    Tags: , , , , , reduce   

    Second Maximum (v2) of list of integers without comparison, loop or recursion 

    Function sm() returns a tuple of the maximum and second maximum of a list of integers without any comparison or loop


    References:

     
  • Dimitris Kalopsikakis 10:02 on 29 November 2016 Permalink | Reply
    Tags: , , ,   

    Second maximum of a list with functional Python 

    Returns the second maximum of a list of numbers


    References:

     
  • Dimitris Kalopsikakis 05:08 on 28 November 2016 Permalink | Reply
    Tags: boolean, , , sgn   

    Sgn function in Python 

    One-line sign function of a real number.

    In Python a boolean variable is subclass of integer taking two values, 0 for False and 1 for True. Also, every boolean expression returns the value of last evaluated argument.


    References:

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel