Skip to content

Instantly share code, notes, and snippets.

View wevtimoteo's full-sized avatar
🎲
Rolling dices

Weverton Timoteo wevtimoteo

🎲
Rolling dices
View GitHub Profile
@wevtimoteo
wevtimoteo / postgresql.sql
Last active September 11, 2015 18:12
SQL queries to use with PostgreSQL to monitor current executing SQL commands
-- activity.sql
select procpid, query_start, current_query from pg_stat_activity WHERE current_query <> '<IDLE>' order by query_start
-- cancel.sql
select pg_cancel_backend(procpid)
@wevtimoteo
wevtimoteo / example.md
Last active February 21, 2024 22:42
Moving files across git repositories preserving history
git clone <git repository A url>
cd <git repository A directory>
git remote rm origin
git filter-branch --subdirectory-filter <directory 1> -- --all
mkdir -p <target-path in="" repo-b="">
git mv -k * <target-path in="" repo-b="">
git add .
git commit
@wevtimoteo
wevtimoteo / response.json
Created July 17, 2015 12:05
API response example with pagination
{
"_metadata":
{
"page": 5,
"per_page": 20,
"page_count": 20,
"total_count": 521,
"Links": [
{"self": "/products?page=5&per_page=20"},
{"first": "/products?page=0&per_page=20"},
@wevtimoteo
wevtimoteo / flags.rb
Created July 11, 2015 02:21
Ruby Flags
# Flags Ruby
# Sentinel to check that the rbenv-vars plugin is in use.
RBENV_VARS_ENABLED=1
# Ruby 2.1 GC reading:
# http://tmm1.net/ruby21-rgengc/
# http://thorstenball.com/blog/2014/03/12/watching-understanding-ruby-2.1-garbage-collector/
# http://samsaffron.com/archive/2013/11/22/demystifying-the-ruby-gc
@wevtimoteo
wevtimoteo / application.rb
Created January 20, 2015 12:12
Custom logging for ActiveRecord
ActiveRecord::Base.logger = CustomLogger.new(STDOUT)
@wevtimoteo
wevtimoteo / rubyinstall.sh
Last active August 29, 2015 14:07
rbenv_install_1_9_2_on_yosemite
rbenv install 1.9.2-p330
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer//usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Downloading ruby-1.9.2-p330.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/23ef45fdaecc5d6c7b4e9e2d51b23817fc6aa8225a20f123f7fa98760e8b5ca9
Installing ruby-1.9.2-p330...
BUILD FAILED (OS X 10.10 using ruby-build 20140919)
Inspect or clean up the working tree at /var/folders/ns/3sn8y8fn1k5crc9l0f1_dqvr0000gp/T/ruby-build.20141021173322.89970
Results logged to /var/folders/ns/3sn8y8fn1k5crc9l0f1_dqvr0000gp/T/ruby-build.20141021173322.89970.log
@wevtimoteo
wevtimoteo / gist:5fd97eaf39f8ea75488f
Created August 6, 2014 03:18
Ignition Break Build
BB+IB (Bowling Bash + Ignition Break)
———————————————————-
*NEW REVISED FOR THE BALANCE PATCH*
Another popular build that lets you level your character pretty fast once you get the hang of it. While the build itself hasn’t changed, the game mechanics have changed so that Ignition Break does do quite a lot more damage compared to before.
Essential Skills
Spear Dynamo 5 (Lord Knight Skill)
@wevtimoteo
wevtimoteo / software_engineer.md
Last active August 29, 2015 13:56
Jobs - Baby.com.br/Dinda.com.br

============================================ Software Engineer @ Dinda.com.br/Baby.com.br

Change the world by building highly scalable, disruptive ecommerce platforms.

Things we value

  • High scalability, extensibility, flexibility
  • Fault tolarance, redundancy
@wevtimoteo
wevtimoteo / .vimrc
Created July 13, 2012 20:54
My current .vimrc
:syntax on
"ruby
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
"improve autocomplete menu color
highlight Pmenu ctermbg=238 gui=bold
:set tabstop=2
@wevtimoteo
wevtimoteo / gist:2830052
Created May 29, 2012 19:02
Recovering my PSN Network password
# encoding: utf-8
require 'spec_helper'
Capybara.configure do |config|
config.current_driver = :selenium
config.run_server = false
config.app_host = 'https://account.sonyentertainmentnetwork.com'
end