Skip to content

Instantly share code, notes, and snippets.

View rejeep's full-sized avatar

Johan Andersson rejeep

View GitHub Profile
@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 '[email protected]&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
@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
(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 / 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)