Skip to content

Instantly share code, notes, and snippets.

View rejeep's full-sized avatar

Johan Andersson rejeep

View GitHub Profile
@rejeep
rejeep / gist:2922929
Created June 13, 2012 09:01
Comment and duplicate line
(defun comment-and-duplicate-line ()
"Copy current line to line below and comment current line."
(interactive)
(let* ((beg (line-beginning-position))
(end (line-end-position))
(line (buffer-substring-no-properties beg end))
(column (current-column)))
(comment-region beg end)
(goto-char (line-end-position))
(newline)
(defun rejeep-projectile-completion-fn (prompt choises)
"Projectile completion function that only shows file name.
If two files have same name, new completion appears to select between
them. These include the path relative to the project root."
(interactive)
(let* ((stripped-choises
(-uniq (--map (file-name-nondirectory it) choises)))
(choise
(ido-completing-read prompt stripped-choises))
@rejeep
rejeep / travis.sh
Last active December 29, 2015 22:19
Setup Evm and Cask on Travis.
#!/bin/sh
# This script will setup Evm (Emacs Version Manager) and Cask on
# Travis to use for Emacs Lisp testing.
#
# In .travis.yml, add this:
#
# - curl -fsSkL https://gist.github.com/rejeep/7736123/raw > travis.sh && source ./travis.sh
#
# Emacs 24.3 is installed in the above script because Cask requires
@rejeep
rejeep / robin.bash
Last active January 27, 2019 19:02
Robin check temperature script
#!/bin/bash
# DEPENDENCIES: brew install jq curl
curl -X POST "https://mypages.verisure.com/j_spring_security_check?locale=sv_SE" \
--data 'j_username=robin@liljeros.nu&j_password=...' \
--cookie cookie.txt \
--cookie-jar cookie.txt
curl -X GET "https://mypages.verisure.com/overview/climatedevice?_=1548613153475" \
#!/bin/sh
# This script will setup Evm (Emacs Version Manager) and Cask on
# Travis to use for Emacs Lisp testing.
#
# In .travis.yml, add this:
#
# - curl -fsSkL https://gist.github.com/rejeep/ebcd57c3af83b049833b/raw > x.sh && source ./x.sh
#
# Emacs 24.3 is installed in the above script because Cask requires