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
(define-test test-hash-table-equality | |
(let ((h1 (make-hash-table :test #'equal)) | |
(h2 (make-hash-table :test #'equal))) | |
(setf (gethash "one" h1) "yat") | |
(setf (gethash "one" h2) "yat") | |
(setf (gethash "two" h1) "yi") | |
(setf (gethash "two" h2) "yi") | |
(true-or-false? nil (eq h1 h2)) | |
(true-or-false? nil (equal h1 h2)) | |
(true-or-false? t (equalp h1 h2)))) |
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
# cat /etc/init/docker-postgres.conf | |
description "Docker container for PostgreSQL" | |
author "Louis Kottmann" | |
start on filesystem and started docker | |
stop on runlevel [!2345] | |
respawn | |
respawn limit 5 30 |
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
(require 'smooth-scroll) | |
(smooth-scroll-mode 1) | |
(defadvice smooth-scroll-mode (around my-smooth-scroll-mode-turn-on-maybe) | |
(unless (memq major-mode | |
(list 'ecb-major-mode)) | |
ad-do-it)) | |
(ad-activate 'smooth-scroll-mode) |
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
start: 11, | |
start_risk: 22, | |
start_soon: 33, | |
restart: 44, | |
recording: 55, | |
recording_errors: 66, | |
restart__: 77, | |
error: 88, | |
done: 99, | |
done_: 10, |
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
test = { | |
lorem: 'ipsum', | |
dolor: 'sit', | |
amet: ', consectetur', | |
adipiscing: 'elit', | |
donec : 'a', | |
diam : 'lectus.' | |
} |
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
test = { | |
lorem: 'ipsum', | |
dolor: 'sit', | |
amet: ', consectetur', | |
adipiscing: 'elit', | |
donec: 'a', | |
diam: 'lectus.' | |
} |
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 align-regexp-lefty(beg end) | |
"After using align-regexp, this will move spaces to the left." | |
(interactive "*r") | |
(save-restriction | |
(narrow-to-region beg end) | |
(save-excursion | |
(goto-char (point-min)) | |
(while (search-forward-regexp "\(\w+\)\ \(\ *\)" nil t) | |
(replace-match "\2\1" nil nil))))) |
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 align-regexp-lefty () | |
"After using align-regexp, this will move spaces to the left." | |
(interactive) | |
(let (pos1 pos2) | |
(if (region-active-p) | |
((setq pos1 (region-beginning) pos2 (region-end)) | |
(save-restriction | |
(narrow-to-region pos1 pos2) | |
(goto-char (point-min)) | |
(while (re-search-forward "\(\w+\)\ \(\ *\)" nil t) |
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
(require 'cl) | |
;; Install missing packages | |
(require 'package) | |
(defvar baboon-packages | |
'(w3 solarized-theme haml-mode | |
slime ecb tabbar | |
powerline auto-complete | |
twittering-mode emms hackernews | |
rinari markdown-mode web-mode) |
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
# File name: cf_nginx_realip.rb | |
if ARGV.first == "--help" | |
puts "Fetches CloudFlare's official IPv4 and IPv6 addresses and formats them for use from NGinx's HttpRealipModule" | |
puts "Usage:\n\truby cf_nginx_realip.rb > cf_realip.conf\n\n" | |
puts 'Then add "include cf_realip.conf" in a http|server|location block of your nginx config' | |
exit | |
end | |
ips = [] |
NewerOlder