Skip to content

Instantly share code, notes, and snippets.

# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
@LouisKottmann
LouisKottmann / bundle help ERROR.md
Last active December 14, 2015 06:09
Error when running bundle help

What you're trying to accomplish

Viewing bundle's documentation

The command you ran

bundle help

What you expected to happen

@LouisKottmann
LouisKottmann / CloudFlare's IPs for NGinx HttpRealipModule
Last active December 19, 2015 12:38
Fetches CloudFlare's official IPv4 and IPv6 addresses and formats them for use from NGinx's HttpRealipModule
# 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 = []
@LouisKottmann
LouisKottmann / baboon-packages.el
Created December 5, 2013 10:51
Emacs package sync
(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)
(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)
(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)))))
@LouisKottmann
LouisKottmann / test data
Last active December 30, 2015 17:29
test data for align-regexp-lefty
test = {
lorem: 'ipsum',
dolor: 'sit',
amet: ', consectetur',
adipiscing: 'elit',
donec: 'a',
diam: 'lectus.'
}
test = {
lorem: 'ipsum',
dolor: 'sit',
amet: ', consectetur',
adipiscing: 'elit',
donec : 'a',
diam : 'lectus.'
}
start: 11,
start_risk: 22,
start_soon: 33,
restart: 44,
recording: 55,
recording_errors: 66,
restart__: 77,
error: 88,
done: 99,
done_: 10,
(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)