This file contains 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-travis-read-log (url) | |
"Retrieve Travis log from URL and render nicely." | |
(interactive (list (read-string "URL: " nil nil (eww-suggested-uris)))) | |
(let ((url (replace-regexp-in-string "^https://travis-ci.org/\\([^/]+\\)/\\([^/]+\\)/jobs/\\([0-9]+\\)" | |
"https://api.travis-ci.org/jobs/\\3/log.txt?deansi=true" | |
url))) | |
(pop-to-buffer-same-window (get-buffer-create "*travis*")) | |
(eww-setup-buffer) | |
(plist-put eww-data :url url) | |
(plist-put eww-data :title "") |
This file contains 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 [[ $# -ge 1 ]]; then | |
author="$1" | |
else | |
author="$(git config user.email)" | |
fi |
This file contains 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
cd apertium-en-es | |
curl https://raw.githubusercontent.com/goavki/streamparser/master/streamparser.py >streamparser.py | |
# put the files of this gist in cwd | |
sh run.sh < sonnet17.xml |
This file contains 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
sudo apt install binutils | |
cd ~/src/an_autotools_project | |
export CXXFLAGS='-fuse-ld=gold' | |
export CFLAGS='-fuse-ld=gold' | |
./configure | |
make -j4 # no longer wait for linking! =D | |
# gcc doesn't support -fuse-ld=lld http://gcc.gnu.org/ml/gcc-patches/2016-07/msg00145.html :( |
This file contains 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 | |
export TMUX_SESSION= | |
if [[ -n ${TMUX+set} ]]; then | |
TMUX_SESSION=$(tmux display-message -p "#S") | |
# can end up wrong if I move a pane to a different session, but I rarely do that | |
if [[ -n ${TMUX_SESSION+set} ]]; then | |
[[ -d ~/.bash_history.d ]] || mkdir -p ~/.bash_history.d | |
export HISTFILE="$HOME/.bash_history.d/${TMUX_SESSION}" | |
[[ -f $HISTFILE ]] || cp "$HOME"/.bash_history "$HISTFILE" |
This file contains 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
# Don't just run this script, but check each command to fix paths etc. | |
# The dd does not need sudo (and becomes more dangerous with sudo ...) | |
# This creates an empty file 1GB large to hold your filesystem: | |
dd if=/dev/zero of=/path/to/sd-card/vfs bs=1024 count=1024000 | |
# Should gives something like: |
This file contains 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 -u | |
# Put "st-state.desktop" in .stignore, then run this on login. | |
# Requires xmllint and wget; uses config.xml to find GUI address, | |
# apikey and folders (so that we can change folder icons even if | |
# syncthing is down) |
This file contains 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 | |
target="$1" | |
get_wpid() { | |
wid="$(xprop -root _NET_ACTIVE_WINDOW | grep -o '0x[^, ]\{7,\}' )" || return 1 | |
xprop -id "${wid}" _NET_WM_PID | grep -o '[0-9]\{1,\}' | |
} |
This file contains 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 DeriveGeneric #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# OPTIONS_GHC -fno-warn-orphans #-} | |
module OurUsers where | |
import Control.Monad.Logger (runNoLoggingT) | |
import qualified Data.Text as T | |
import GHC.Generics |
This file contains 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
(use-package evil-leader | |
;; needs to be enabled before M-x evil-mode! | |
:ensure t | |
:config | |
(evil-leader/set-leader ",") | |
(evil-leader/set-key-for-mode #'haskell-mode | |
"t" #'intero-type-at ; was: haskell-mode-show-type-at | |
"T" #'intero-info ; was: haskell-doc-show-type | |
"I" #'haskell-do-info |