Skip to content

Instantly share code, notes, and snippets.

View Khoulaiz's full-sized avatar
🏠
Working from home

Andreas Sahlbach Khoulaiz

🏠
Working from home
View GitHub Profile
@Khoulaiz
Khoulaiz / spacemacs-cheatsheet.md
Created August 22, 2017 11:17 — forked from davoclavo/spacemacs-cheatsheet.md
Spacemacs cheatsheet

emacs --daemon to run in the background. emacsclient.emacs24 <filename/dirname> to open in terminal

NOTE: "M-m and SPC can be used interchangeably".

  • Undo - C-/
  • Redo - C-?
  • Change case: 1. Camel Case : M-c 2. Upper Case : M-u
  1. Lower Case : M-l
@Khoulaiz
Khoulaiz / ec
Last active May 16, 2017 20:56 — forked from tasmo/ec
Start Emacs Client in GUI (and launch Emacs server if not already running)
#!/usr/bin/env bash
# Shamelessly taken from http://mjwall.com/blog/2013/10/04/how-i-use-emacs/
# This script starts emacs daemon if it is not running, opens whatever file
# you pass in and changes the focus to emacs. Without any arguments, it just
# opens the current buffer or *scratch* if nothing else is open. The following
# example will open ~/.bashrc
# ec ~/.bashrc
@Khoulaiz
Khoulaiz / .profile
Created May 16, 2017 20:54 — forked from tasmo/.profile
snipped for ediff with emacsclient for POSIX shells
### editor
export ALTERNATE_EDITOR=emacs
export EDITOR="emacsclient -tc -a emacs"
export VISUAL="emacsclient -c -a emacs"
# emacsclient as difftool
function ediff () {
if [ "X${2}" = "X" ]; then
echo "USAGE: ediff <FILE 1> <FILE 2>"
else
quoted1=${1//\\/\\\\}; quoted1=${quoted1//\"/\\\"}
@Khoulaiz
Khoulaiz / nginx-lang.lua
Created January 30, 2016 08:58 — forked from colthreepv/nginx-lang.lua
Detect preferred language script for Nginx written in LUA
-------------------------------------------------------------------------------
-- HTTP Accept-Language header handler --
-- @originalAuthor: f.ghibellini@gmail.com --
-- @originalRepository: https://github.com/fghibellini/nginx-http-accept-lang--
-- @modifiedBy: marian.hello@mapilary.com --
-- @gist: https://gist.github.com/mauron85/47ed1075262d9e020fe2 --
-- @license: MIT --
-- @requires: --
-- @description: --
-- returns language with greatest quality --
var inputs = document.getElementsByTagName('input');
for (var i=0; i < inputs.length; i++) {
if (inputs[i].getAttribute('type').toLowerCase() === 'password') {
inputs[i].setAttribute('onpaste', '');
}
}