Skip to content

Instantly share code, notes, and snippets.

View edgar's full-sized avatar

Edgar Gonzalez edgar

View GitHub Profile
v1 = '0.3.2'
v2 = '0.10.1'
a1 = v1.split('.').map{|v| v.to_i}
a2 = v2.split('.').map{|v| v.to_i}
(a1 <=> a2) < 0 # v1 < v2
=> true
(a1 <=> a2) > 0 # v1 > v2
=> false
$ gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.5/bin/pg_config
@edgar
edgar / pg_install_error_mac.txt
Created May 22, 2016 17:18
install error for pg gem in OS X
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
...
Can't find the 'libpq-fe.h header
...
@edgar
edgar / getBlockLists.sh
Created April 24, 2016 13:19 — forked from johntyree/getBlockLists.sh
Make one large blocklist from the bluetack lists on iblocklist.com
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'
@edgar
edgar / iterm2-solarized.md
Created April 24, 2016 01:03 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + oh my zsh + solarized + Meslo powerline font (OSX)

Solarized

# The newrelic agent generates its own log file to keep its logging
# information separate from that of your application. Specify its
# log level here.
log_level: 'error'
# Optionally set the path to the log file This is expanded from the
# root directory (may be relative or absolute, e.g. 'log/' or
# '/var/log/') The agent will attempt to create this directory if it
# does not exist.
# log_file_path: 'log'
# NewRelic rpm
# agent_logger.rb#L134-L136
def wants_stdout?
::NewRelic::Agent.config[:log_file_path].upcase == "STDOUT"
end
set :logging, true
@edgar
edgar / Makefile
Created April 9, 2016 16:59
Docker compose and makefile using docker-wait
IMAGE_NAME := "foo"
docker-build:
@(docker build -t $(IMAGE_NAME) -f Dockerfile .)
test: docker-build
@(docker-compose -f dockercompose/test.yml up -d)
@(docker-compose -f dockercompose/test.yml run wait)
@(docker-compose -f dockercompose/test.yml run search bash -c "rspec")
@(docker-compose -f dockercompose/test.yml down)
@edgar
edgar / Makefile
Created April 9, 2016 16:51
Makefile with sleeo
IMAGE_NAME := "foo"
docker-build:
@(docker build -t $(IMAGE_NAME) -f Dockerfile .)
test: docker-build
@(docker-compose -f dockercompose/test.yml up -d)
@(docker-compose -f dockercompose/test.yml run search bash -c "sleep 15; rspec")
@(docker-compose -f dockercompose/test.yml down)