Skip to content

Instantly share code, notes, and snippets.

View weverton's full-sized avatar

Weverton Gomes de Morais weverton

  • Goiania, Goias, Brazil
View GitHub Profile
select * from
(SELECT
t.NAME AS TableName,
s.Name AS SchemaName,
p.rows AS RowCounts,
(SUM(a.total_pages) * 8) /1024 AS TotalSpaceMB,
(SUM(a.used_pages) * 8) /1024 AS UsedSpaceMB,
((SUM(a.total_pages) - SUM(a.used_pages)) * 8) /1024 AS UnusedSpaceMB
FROM
sys.tables t
program Project1;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
Windows, Classes,
TlHelp32, PsAPI;
@weverton
weverton / map_reduce.rake
Last active October 28, 2016 18:27
Arquivo de exemplo de execução de Map Reduce com Ruby
# encoding: utf-8
namespace :map_reduce do
[:development, :production, :staging].each do |env|
namespace env do
desc "Process map reduce from accountants"
task :accountant => :environment do
Mongoid.load! File.join(Rails.root, "config/mongoid.yml"), env
session = Moped::Session.new(["127.0.0.1:27017"]);
@weverton
weverton / gist:5715477
Created June 5, 2013 17:00
MongoClient example
var mongodb = require('mongodb');
var nodemailer = require('nodemailer');
var cls = require('./plugins/class');
var MongoClient = require('mongodb').MongoClient
var Server = require('mongodb').Server;
Teste = Class.create({
prepare: function() {
this.connection_mongo = new mongodb.Db("gravacao", srv, {w: 1});
this.connection_mongo.open(function(err, db){});
@weverton
weverton / deploy.rb
Last active December 15, 2015 09:29
require "bundler/capistrano"
server "my_server", :web, :app, :db, primary: true
set :application, "my_app"
set :user, "deployer"
set :deploy_to, "/home/#{user}/apps/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, false
/home/deployer/.rbenv/versions/1.9.3-p392/bin/ruby extconf.rb
checking for CLOCK_MONOTONIC in time.h... yes
checking for clockid_t in time.h... yes
checking for clock_gettime() in -lrt... yes
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for poll() in poll.h... yes
checking for getaddrinfo() in sys/types.h,sys/socket.h,netdb.h... yes
checking for getnameinfo() in sys/types.h,sys/socket.h,netdb.h... yes
checking for struct sockaddr_storage in sys/types.h,sys/socket.h... yes