This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Control.Applicative | |
import Data.Attoparsec.ByteString | |
import qualified Data.ByteString as S | |
import Data.Char (ord) | |
import GHC.Word (Word8) | |
import Prelude hiding (takeWhile) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: | |
# chmod +x with-focus | |
# ./with-focus CMD ARG1 ARG2 | |
# e.g. | |
# ./with-focus xfce4-terminal | |
# ./with-focus mousepad file.txt | |
# When this script exits, turn focus_new back to false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun my-flycheck-gawk-fix-message (err) | |
"Remove the repeated file-name/line from the error message of ERR." | |
(setf (flycheck-error-message err) | |
(replace-regexp-in-string | |
"^\\([ \t]*\\)\\(.*\n\\)\\1" | |
"\\2" | |
(replace-regexp-in-string | |
"\ngawk: [^ ]*:" | |
"\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
_xsv() | |
{ | |
cur=${COMP_WORDS[COMP_CWORD]} | |
prev=${COMP_WORDS[COMP_CWORD-1]} | |
cmds=$(xsv --list|awk '/Installed/{next}/./{print $1}') | |
while read -r cmd; do | |
if [[ "${prev}" = "${cmd}" ]]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'bbdb) | |
(defun my-bbdb-notmuch-search (&optional record) | |
"Search for emails to/from RECORD (or current record if interactive)." | |
(interactive) | |
(let* ((record (or record (bbdb-current-record))) | |
(mails (bbdb-record-field record 'mail)) | |
(query (combine-and-quote-strings mails " OR "))) | |
(notmuch-search query))) | |
(define-key bbdb-mode-map (kbd "F") 'my-bbdb-notmuch-search) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# A SpaCy implementation of | |
# https://github.com/Babylonpartners/fastText_multilingual | |
# | |
# heavily based on | |
# https://github.com/Babylonpartners/fastText_multilingual/blob/master/align_your_own.ipynb | |
import numpy as np |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; erc-join.el --- autojoin channels on connect and reconnects | |
;; Copyright (C) 2002-2004, 2006-2016 Free Software Foundation, Inc. | |
;; Author: Alex Schroeder <[email protected]> | |
;; Maintainer: [email protected] | |
;; Keywords: irc | |
;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcAutoJoin | |
;; This file is part of GNU Emacs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ echo aðc | LANG=C.UTF-8 grep -o '[[:lower:]]' | |
a | |
ð | |
c | |
$ echo aðc | LANG=C.UTF-8 grep -o '[[:upper:]]' | |
$ echo aðc | LANG=C.UTF-8 grep -o '[A-Z]' | |
$ # so far so good | |
$ echo aðc | LANG=nn_NO.UTF-8 grep -o '[[:lower:]]' | |
a | |
ð |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ignore] | |
[include] | |
[libs] | |
[options] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; See http://www.emacswiki.org/emacs/EdiffMode#toc2 | |
(setq ediff-window-setup-function ; I hate having multiple frames | |
'ediff-setup-windows-plain) | |
(setq ediff-split-window-function (lambda (&optional arg) | |
(if (> (frame-width) 156) | |
(split-window-horizontally arg) | |
(split-window-vertically arg)))) | |
(defun ediff--regions-samebuffer (ediff-regions &optional startup-hooks) | |
(let ((cloned-buffer (clone-indirect-buffer-other-window nil t))) |