Skip to content

Instantly share code, notes, and snippets.

View roolo's full-sized avatar

Mailo Světel roolo

View GitHub Profile
@roolo
roolo / Error
Created May 6, 2013 11:30
Fix for RMagick 2.12.2 vs. ImageMagick. Mac, Homebrew
Can't install RMagick 2.12.2. Can't find the ImageMagick library or one of the dependent libraries. Check the mkmf.log file for more detailed information.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
@roolo
roolo / README.md
Last active January 12, 2016 13:56

Upgrading data from Postgres 9.4 to Postgres 9.5

Solving the The data directory was initialized by PostgreSQL version 9.4, which is not compatible with this version 9.5.0. panic ;) This is mainly for Postgres installed via Homebrew, but you can adapt it to your system pretty easily.

@roolo
roolo / My Chrome.scpt
Last active January 8, 2016 10:00
Launch chrome profile on MacOS X
do shell script "/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome --user-data-dir=\"/Volumes/PrivateHome/ChromeProfile\" > /dev/null 2>&1 &"
@roolo
roolo / gist:8538765
Last active January 3, 2016 23:59
Reset author in git
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Mailo Světel'
GIT_AUTHOR_EMAIL='development@rooland.cz'
GIT_COMMITTER_NAME='Mailo Světel'
GIT_COMMITTER_EMAIL='development@rooland.cz'
" HEAD
visit('page.com/which-make-sense')
click_button('send')
@roolo
roolo / documentatar.rb
Created November 5, 2013 14:58
Sinatra basic documentation for API. This code as it is generates code for Markdown
after do
TEST_DOCUMENTATION_FILE << "\n## %s %s"%[request.request_method,request.path_info]
TEST_DOCUMENTATION_FILE << "\n### Request"
TEST_DOCUMENTATION_FILE << "\n "+JSON.pretty_generate(
JSON.parse(request.POST.to_json)
).gsub(/\n/, "\n ")
TEST_DOCUMENTATION_FILE << "\n### Response"
response_formatted = JSON.pretty_generate(
JSON.parse(response.body.first)
).gsub(/\n/, "\n ")
@roolo
roolo / replace.md
Created November 1, 2013 12:39
Strip trailing whitespaces

Replace:

/\n\s+\n/

With:

/\n\n/
@roolo
roolo / gist:7151356
Created October 25, 2013 08:28
Sinatra – json by default
before do
content_type 'application/json'
end
@roolo
roolo / gist:7040779
Created October 18, 2013 12:24
Prosody 0.9.1 install on OSX Lion
[~]$ brew install http://prosody.im/files/homebrew/prosody_0.9.1.rb [ruby-2.0.0-p247]
######################################################################## 100.0%
Installing http://www.luarocks.org/repositories/rocks/luasocket-2.0.2-5.src.rock...
Using http://www.luarocks.org/repositories/rocks/luasocket-2.0.2-5.src.rock... switching to 'build' mode
Archive: /private/tmp/luarocks_luarocks-rock-luasocket-2.0.2-5-7448/luasocket-2.0.2-5.src.rock
inflating: luasocket-2.0.2-5.rockspec
inflating: luasocket-2.0.2.tar.gz
cd src; make all
export MACOSX_DEPLOYMENT_TARGET=10.5; gcc -O2 -fPIC -DLUASOCKET_DEBUG -DUNIX_HAS_SUN_LEN -fno-common -I/usr/local/opt/lua/include -c -o luasocket.o luasocket.c
export MACOSX_DEPLOYMENT_TARGET=10.5; gcc -O2 -fPIC -DLUASOCKET_DEBUG -DUNIX_HAS_SUN_LEN -fno-common -I/usr/local/opt/lua/include -c -o timeout.o timeout.c
@roolo
roolo / README.md
Last active December 24, 2015 17:09
CSS3 Animation demo

CSS3 Animation demo

Video on BLI.MS