Skip to content

Instantly share code, notes, and snippets.

@viocost
viocost / readme.md
Last active June 26, 2019 09:48
[Emacs tricks] Useful commands and tricks in emacs #emacs #cheatsheet
  • Open clickable text in a new window: C-u RET

  • Insert multile of same char: C-u 8 * to insert 8 of *

  • Delete till the end of the line: C-k

  • Delete till the end of a sentence: M-k

  • Delete word after the cursor: M-d

  • Open file in new window: C-x 4 C-f filename

@viocost
viocost / DefaultKeyBindings.dict
Created June 1, 2019 15:41 — forked from Jimbly/DefaultKeyBindings.dict
Mac OSX keybindings to more closely match Windows
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more closely
match default behavior on Windows systems.
You must log out and back in to see these changes.
Here is a rough cheatsheet for syntax.
Key Modifiers
^ : Ctrl
$ : Shift
@viocost
viocost / emacs-cheat-sheet.md
Last active May 13, 2019 17:24 — forked from 6D65/emacs-cheat-sheet.md
My emacs cheat sheet

In penance for cracking stupid jokes on Twitter, here's my Emacs cheat sheet. Emacs has a steep learning curve, so I've tried to order them by importance so you could learn them in stages.

One overall rule of thumb: pay attention to the minibuffer (the line at the bottom of the editor). It will often guide you through a process, and also gives you hints about what state you're in, such as the middle of a multi-chord sequence.

The other rule of thumb: when in doubt, C-g it out.

Basics (mandatory)

You simply can't get by without having these at your fingertips.

@viocost
viocost / README.md
Last active May 11, 2019 19:21
[Vim python setup] Vim as python IDE setup #vim #setup #python
  1. Install neovim
  2. Run to get plug installer
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs     https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  1. Create .vimrc in homedir
  2. Insert into beginning of .vimrc this line:
call plug#begin('~/.local/share/nvim/plugged')
@viocost
viocost / vim-cheatsheet.md
Last active May 13, 2019 15:26 — forked from nerdalert/vim-cheatsheet.md
VIM Cheatsheet #vim #cheatsheet

VIM Cheatsheet

Cursor movement

h - move cursor left  
j - move cursor down
k - move cursor up
l - move cursor right

w - jump forwards to the start of a word

@viocost
viocost / README.md
Last active May 11, 2019 06:28
[Libtorrent linux build] building libtorrent python bindings in Linux from source using Boost #libtorrent #linux #build

Building libtorrent for Linux requires Boost.Python to be built separately, while on Mac and Windows Boost.Python is integratind in libtorrent.

Pre-requisites: 1. Installed python 3.7

  1. Download boost
  2. Unpack to ~/boost for convenience
  3. Run ~/boost/boostsrap.sh.
@viocost
viocost / gist:718b19d4e97bde97c6980696a8094259
Last active May 11, 2019 05:57
Building libtorrent bindings from source on Mac OS 10.12 Sierra #libtorrent #macos

Libtorrent version 1.2.0 Python 3.7.2 Boost 1.69.0

  1. installing python 3.7.2
  2. Downloading libtorrent source
  3. Downloading boost and unpacking it for convenience to ~/boost, such that bootstrap.sh would be in ~/boost/bootstrap.sh
  4. Running ~/boost/bootstrap.sh
  5. Copy files "b2" and "bjam" from ~/boost to /usr/local/bin
@viocost
viocost / open-vm-tools-vmware-ubuntu-sharing.md
Created October 30, 2018 19:31 — forked from darrenpmeyer/open-vm-tools-vmware-ubuntu-sharing.md
open-vm-tools and VMWare Shared Folders for Ubuntu guests

(NB: adapted from this Ask Ubuntu thread -- tested to work with Ubuntu 16 LTS branches and Ubuntu 17.10)

Unlike using VMWare Tools to enable Linux guest capabilities, the open-vm-tools package doesn't auto-mount shared VMWare folders. This can be frustrating in various ways, but there's an easy fix.

TL;DR

Install open-vm-tools and run:

sudo mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other
@viocost
viocost / HOWTODMG.md
Created October 26, 2018 20:04 — forked from jadeatucker/HOWTODMG.md
How to create a "DMG Installer" for Mac OS X

Creating a "DMG installer" for OS X

A DMG Installer is convenient way to provide end-users a simple way to install an application bundle. They are basically a folder with a shortcut to the Applications directory but they can be customized with icons, backgrounds, and layout properties. A DMG file (.dmg) is a Mac OS X Disk Image file and it is used to package files or folders providing compression, encryption, and read-only to the package.

##Creating the DMG file #Disk Utility