Skip to content

Instantly share code, notes, and snippets.

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

GilcierWeb gilcierweb

🏠
Working from home
View GitHub Profile
@gilcierweb
gilcierweb / number.rb
Last active August 29, 2015 14:21
Function format number Ruby
#number.rb
puts 'Informe um número'
number = gets.chomp
def format_number(number)
for num in 0..number.to_i
puts num.to_s.reverse.gsub(/(\d{3})(?=\d)/, '\\1,').reverse
end
#!/usr/bin/ruby
# test gilcier
# In terminal execute ruby palindrome.rb
class String
def initialize(word)
@word = word.to_s.strip.downcase
end
<?php
//FCM setup for Android Push Notifications
//https://medium.com/@ankushaggarwal/gcm-setup-for-android-push-notifications-656cfdd8adbd#.qootgsyzm
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
(
'message' => 'GilcierWeb App ionic, Ruby and Rails, Elixir',
@gilcierweb
gilcierweb / pt-BR.yml
Created March 12, 2017 19:29
Translate pt-BR Ruby on Rails
pt-BR:
activerecord:
errors:
template:
header:
one: "1 erro proibiu este %{model} de ser salvo:"
other: "%{count} erros proibiram este %{model} de ser salvo:"
body: 'Ocorreram problemas com os seguintes campos:'
messages:
record_invalid: 'A validação falhou: %{errors}'
@gilcierweb
gilcierweb / cidadesBrasilerias.yml
Last active June 24, 2017 21:11
Cidades do Brasil IBGE 2014
31|1|12|1200013|Acrelândia
31|1|12|1200054|Assis Brasil
31|1|12|1200104|Brasiléia
31|1|12|1200138|Bujari
31|1|12|1200179|Capixaba
31|1|12|1200203|Cruzeiro do Sul
31|1|12|1200252|Epitaciolândia
31|1|12|1200302|Feijó
31|1|12|1200328|Jordão
31|1|12|1200336|Mâncio Lima
@gilcierweb
gilcierweb / deploy.rb
Created October 12, 2017 20:43
Mina deploy ruby on rails 5.1 ++
require 'mina/rails'
require 'mina/git'
require 'mina/rbenv' # for rbenv support. (https://rbenv.org)
# require 'mina/rvm' # for rvm support. (https://rvm.io)
set :application_name, 'my_app'
set :domain, 'my_server'
set :deploy_to, '/home/rails/my_app'
set :repository, 'git@bitbucket.org:my_user/my_app.git'
set :branch, 'master'
@gilcierweb
gilcierweb / _form.html.erb
Last active March 20, 2021 12:49
Upload image crop with Ruby and Rails, CarrierWave and Cropper.js
#app/views/businesses/_form.html.erb
<%= form_with(model: business, scope: :business, local: true, :html => {multipart: true}) do |form| %>
<div class="row">
<div class="col-md-12">
<%= form.file_field :logo_image, id: :business_logo_image %>
<%= form.label :logo_image, class: 'upload' do %>
<i class="material-icons">file_upload</i>
<span>Choose image</span>
@gilcierweb
gilcierweb / index.html
Last active May 12, 2022 05:13
Component Vue.js search CEP or Zip code
<!doctype html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="author"
content="GilcierWeb - Web Developer - gilcierweb@gmail.com - gilcier06@yahoo.com.br - Sites, Sistemas para Web, E-commerce, Manutenção de Sites."/>
<meta name="doc-rights" content="Private"/>