Skip to content

Instantly share code, notes, and snippets.

View heliohead's full-sized avatar
🏠
Working from home

Helio Oliveira heliohead

🏠
Working from home
View GitHub Profile
<% @uploads.each do |upload| %>
<%= link_to image_tag(upload.img.url(:thumb), rel: "prettyPhoto"), image_path(upload.img.url(:original)) %>
<% end %>
output:
<a href="/system/uploads/imgs/000/000/016/original/pics06.jpg?1402887326"><img alt="Pics06" rel="prettyPhoto" src="/system/uploads/imgs/000/000/016/thumb/pics06.jpg?1402887326" /></a>
How to put "rel" in to anchor? instead image tag.
# lib/tasks/deploy.rake
namespace :deploy do
desc 'Deploy to staging environment'
task :staging do
exec 'mina deploy -f config/deploy/staging.rb'
end
end
#!/usr/bin/env bash
# bash completion for azk
#
# If you using zsh needed to.... echo 'autoload -U bashcompinit && bashcompinit' >> ~/.zshrc
_azk(){
local cur commands
### Keybase proof
I hereby claim:
* I am heliohead on github.
* I am heliohead (https://keybase.io/heliohead) on keybase.
* I have a public key whose fingerprint is 3879 A5A6 9ECE 6C45 9301 4B6A EE4D 2089 E743 CC53
To claim this, I am signing this object:
; -*- mode: dotspacemacs -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun global-set-keys (key def &rest bindings)
(while key
(global-set-key (kbd key) def)
(setq key (pop bindings)
def (pop bindings))))
@heliohead
heliohead / db.rake
Created October 19, 2015 10:26 — forked from hopsoft/db.rake
Rails rake tasks for dump & restore of PostgreSQL databases
# lib/tasks/db.rake
namespace :db do
desc "Dumps the database to db/APP_NAME.dump"
task :dump => :environment do
cmd = nil
with_config do |app, host, db, user|
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump"
end
puts cmd
@heliohead
heliohead / rake_db.rb
Created January 17, 2016 22:07
Rails data base rake
rake db:migrate # runs (single) migrations that have not run yet.
rake db:create # creates the database
rake db:drop # deletes the database
rake db:schema:load # creates tables and columns within the (existing) database following schema.rb
rake db:setup does db:create, db:schema:load, db:seed
rake db:reset does db:drop, db:setup
@heliohead
heliohead / .vimrc
Last active November 27, 2016 19:10 — forked from aristotelesbr/.vimrc
my vimrc
"*****************************************************************************
"" Vim-PLug core
"*****************************************************************************
if has('vim_starting')
set nocompatible " Be iMproved
endif
let vimplug_exists=expand('~/.vim/autoload/plug.vim')
let g:vim_bootstrap_langs = "elixir,javascript,python,ruby"
@heliohead
heliohead / feature_helper.rb
Created April 4, 2017 00:06
Compile assets before run rspec features test
# spec/support/feature_helper.rb
RSpec.configure do |config|
config.before :all do
ENV['PRECOMPILE_ASSETS'] ||= begin
case self.class.metadata[:type]
when :feature, :view
STDOUT.write "Precompiling assets..."
system "bundle exec rake assets:precompile > /dev/null 2>&1"
@heliohead
heliohead / brazilian_cities.csv
Created November 5, 2017 14:10
List of Brazilians cities with population, lat an long
uf name iso iso_ddd population lat lng
'RO' 'Alta Floresta D\'oeste' 1100015 '69' 25578 '-11.9287293' '-61.9958651'
'RO' 'Ariquemes' 1100023 '69' 104401 '-9.9061087' '-63.0330263'
'RO' 'Cabixi' 1100031 '69' 6355 '-13.4623774' '-60.6285091'
'RO' 'Cacoal' 1100049 '69' 87226 '-11.434693' '-61.4566885'
'RO' 'Cerejeiras' 1100056 '69' 17986 '-13.2109867' '-61.2801996'
'RO' 'Colorado do Oeste' 1100064 '69' 18817 '-13.1178429' '-60.5459451'
'RO' 'Corumbiara' 1100072 '69' 8842 '-12.9986334' '-60.9460084'
'RO' 'Costa Marques' 1100080 '69' 16651 '-12.4380262' '-64.2268052'
'RO' 'Espigão D\'oeste' 1100098 '69' 32385 '-11.5323149' '-61.0169967'