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 #-} | |
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-} | |
import Data.List | |
import Data.List.Split | |
import System.Environment | |
import qualified Data.Text.Lazy as T | |
import qualified Data.Text.Lazy.IO as TIO | |
-- assumes sorted input |
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
(defvar *query-replace-matching-lines-history* nil) | |
(defun query-replace-matching-lines-read-arg () | |
(let* ((default (or (car *query-replace-matching-lines-history*) | |
"^")) | |
(input | |
(read-from-minibuffer | |
(concat "Line regexp" | |
(if default | |
(format " (default: %s): " (query-replace-descr default)) |
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 | |
set -e -u | |
if [[ $# -ne 1 ]];then | |
echo "Usage: $0 PERIOD" | |
echo "For every PERIOD lines, output a random line from that set of lines" | |
echo "E.g. printf '%s\n' {1..30} | $0 7" | |
echo "might output 5, 12, 19, 23 and 30." | |
exit 1 |
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 | |
# Save this file to e.g. ~/src/apertium-ca.sh, then put "source | |
# ~/src/apertium-ca.sh" in ~/.bashrc Now you can type "ca nno" to go | |
# to languages/apertium-nno and "ca kir kaz" to go to | |
# nursery/apertium-kaz-kir – even though it's in the other order | |
export APERTIUM_SVNROOT=$HOME/src/apertium | |
ca () { |
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
(defvar-local dix-yas-key-rex "" | |
"Used by `dix-yas-update-key-rex' for caching the regex-opt of | |
possible snippet keys.") | |
(defvar-local dix-yas-key-rex-tables nil | |
"Used by `dix-yas-update-key-rex' for checking if we need to | |
update `dix-yas-key-rex'.") | |
(defun dix-yas-update-key-rex () | |
"Update `dix-yas-key-rex', used by `dix-yas-skip-backwards-to-key'." | |
(let ((tables (yas--get-snippet-tables))) |
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
(eval-after-load "company-ycmd-autoloads" | |
'(progn (company-ycmd-setup))) | |
(eval-after-load "ycmd-autoloads" | |
'(progn (require 'ycmd-next-error) | |
(set-variable 'ycmd-server-command '("python2" "/home/me/src/ycmd/ycmd/__main__.py")) ; doesn't understand '~' | |
(set-variable 'ycmd-global-config "/home/me/.emacs.d/.ycm_extra_conf.py") | |
(add-hook 'c-mode-common-hook 'ycmd-mode) | |
(add-hook 'c-mode-common-hook 'company-mode) | |
(add-hook 'python-mode-hook 'ycmd-mode) |
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
# The apache server is SSL-enabled, passes requests that hit /thesubdir to localhost:8080 over http | |
ProxyPreserveHost On | |
ProxyRequests Off | |
<Location "/thesubdir"> | |
ProxyPass http://0.0.0.0:8080/thesubdir | |
ProxyPassReverse http://0.0.0.0:8080/thesubdir | |
</Location> |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title> | |
Snåase - aktivyøki eatnaminie - Snåsa kommune | |
</title> | |
<link href="/nordtrondelag/snasa/snasak.nsf/cascadingstylesheet.css" rel="stylesheet" type="text/css"/> | |
</head> | |
<body bgcolor="#FFFFFF" class="innholdskolonne defaulttext" style="background-image:none" text="#000000"> | |
<form action=""> |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title> | |
Snåase - aktivyøki eatnaminie - Snåsa kommune | |
</title> | |
<link href="/nordtrondelag/snasa/snasak.nsf/cascadingstylesheet.css" rel="stylesheet" type="text/css"/> | |
</head> | |
<body bgcolor="#FFFFFF" class="innholdskolonne defaulttext" style="background-image:none" text="#000000"> | |
<span><span>A</span></span> |
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/sh | |
set -u | |
c14n_sort () | |
{ | |
# The order of <parallel_text> elements does not matter. Assuming | |
# input has been through c14n, we can just sort those lines. | |
awk ' | |
/<version>XSLtemplate/{next} |
OlderNewer