Skip to content

Instantly share code, notes, and snippets.

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

Uriel Juliatti urieljuliatti

🏠
Working from home
  • Ruby on Rails Software Engineer
  • Vitória, Brasil
  • 20:32 (UTC -03:00)
  • LinkedIn in/uriel-valle
View GitHub Profile
@urieljuliatti
urieljuliatti / History|-10f5620e|entries.json
Created February 12, 2023 20:38 — forked from peimelo/History|-10f5620e|entries.json
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///Users/melo/Projects/Angular/controlled-health-frontend/src/app/exams/services/exams-facade.service.ts","entries":[{"id":"qela.ts","timestamp":1650461783059},{"id":"1DVY.ts","timestamp":1650462325935},{"id":"mUEH.ts","timestamp":1650462392089},{"id":"FCQI.ts","timestamp":1650463035177}]}
def create_field(field, field_attributes)
# Multiple values
if field_attributes.is_a?Array or field_attributes.is_a?ActiveRecord::Associations::CollectionProxy
multiple_values = []
field_attributes.each do |atr|
atr = atr.attributes if field_attributes.is_a?ActiveRecord::Associations::CollectionProxy
atr.reject! {|k,v| k.eql?"id" }
atr.merge!({ :user_id => self.address_book.user.id })
multiple_values << field.singularize.camelize.constantize.new(atr)
end
#encoding: utf-8
module M3nd3s
def me_ajuda!
"NÃO"
end
end
#encoding: utf-8
module T3L4R0L1
def me_ajuda?(dinheiro)
if dinheiro > 500
"SIM"
else
"NÃO"
end
end
end
SELECT *,
( 3959 * acos( cos( radians('#{latitude}') ) *
cos( radians( latitude ) ) *
cos( radians( longitude ) -
radians('#{longitude}') ) +
sin( radians('#{latitude}') ) *
sin( radians( latitude ) ) ) )
AS distance, a_b.name as neighbourhood_name FROM address_neighbourhood_users INNER JOIN address_neighbourhoods AS a_b ON a_b.neighbour_code = address_neighbourhood_users.address_neighbourhood_code AND ( 3959 * acos( cos( radians('#{latitude}') ) *
cos( radians( latitude ) ) *
cos( radians( longitude ) -
@urieljuliatti
urieljuliatti / modelo3.java
Created March 15, 2012 00:04
modelo3.java
// Sistemas distribuidos
Servidor.main{
ServerSocket servidor = new ServerSocket(int porta);
ArrayList<Socket> clientes = new ArrayList<Socket>(); // Só cria para a conexão
while(true){
Socket cliente = servidor.accept();
clientes.add(cliente);
Observador observador = new Observador(cliente, clientes); // runnable
Thread processo = new Thread(observador);
processo.start();
source 'https://rubygems.org'
gem 'rails', '3.2.0'
gem 'mysql2'
gem 'devise', "~>2.0.0"
gem 'cancan'
gem 'jquery-rails'
gem 'capistrano'
gem 'omniauth'
gem 'omniauth-facebook'
@urieljuliatti
urieljuliatti / gist:1854082
Created February 17, 2012 15:42
Problemas com Capistrano no Server
(ruby-1.9.2-p290@stressmeter) urieljuliatti@Uriel-Juliattis-MacBook-Pro ~/Projects/stressmeter (master)
$ cap deploy
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
executing locally: "git ls-remote [email protected]:urieljuliatti/stressmeter.git master"
command finished in 3932ms
* executing "git clone -q [email protected]:urieljuliatti/stressmeter.git /home/uriel/stressmeter/releases/20120217153451 && cd /home/uriel/stressmeter/releases/20120217153451 && git checkout -q -b deploy 8b0bf3195004df14e9cdd3ae4a37de4d7eaaaf5b && (echo 8b0bf3195004df14e9cdd3ae4a37de4d7eaaaf5b > /home/uriel/stressmeter/releases/20120217153451/REVISION)"
servers: ["stressmeter.urieljuliatti.com"]
@urieljuliatti
urieljuliatti / urieljuliatti
Created February 15, 2012 17:42
Nginx Config
server {
listen 80;
server_name stressmeter.urieljuliatti.com;
access_log /var/log/nginx/production.stressmeter.access.log;
root /home/uriel/stressmeter/current/public;
# Passenger
passenger_enabled on;
require "bundler/capistrano"
set :application, "stressmeter"
set :scm, :subversion
role :app, "stressmeter.urieljuliatti.com"
role :web, "stressmeter.urieljuliatti.com"
role :db, "stressmeter.urieljuliatti.com", :primary => true