Skip to content

Instantly share code, notes, and snippets.

View midhunkrishna's full-sized avatar

Midhun Krishna midhunkrishna

View GitHub Profile
Multiple Tasks
- Organizational policy management.
- Assigns to multiple users -> Organization users can be assigned to multiple users.
- Notify users to email / and system wise notifications.
- User policy / configureable policy with policy management.
- Overall organizational health
- User management / and roles
@midhunkrishna
midhunkrishna / logger.rb
Created November 6, 2018 07:31
simple ruby threadsafe logger
# Usage:
# DebugTools::Logger.log(String)
require 'fileutils'
module DebugTools
class Logger
def self.log(message)
FileUtils.touch(path) unless File.exist?(path)
QUERY PLAN
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-------------------------------------------------------
Limit (cost=8558.43..8558.48 rows=20 width=20)
-> Sort (cost=8558.43..8563.87 rows=2175 width=20)
Sort Key: (CASE WHEN ((importance = '0'::double precision) OR (importan
ce IS NULL)) THEN ('0.75001'::double precision - ((search_rank)::double precisio
n / '40'::double precision)) ELSE importance END) DESC
  • Api::TenderingRequestsController processes accept response - spec.controllers.api.tendering_requests_controller_spec spec/controllers/api/tendering_requests_controller_spec.rb
  • DeliveriesController should handle reject action - spec.controllers.deliveries_controller_spec spec/controllers/deliveries_controller_spec.rb
  • Delivery features Accept delivery - spec.features.delivery_spec spec/features/delivery_spec.rb
  • TenderingRequest shows correct activity item when you cancel early, retender, and let timeout occur - spec.models.tendering_request_spec spec/models/tendering_request_spec.rb
  • Edit Route features behaves like Feature::EditRouteFeatures Consolidation with creating new deliveries 2 - spec.features.edit_route_features_spec spec/features/edit_route_features_spec.rb
Debug output for Geocode::lookup
Geocode: 'Query' => 'New York'
'Structured query' => False
'Name keys' => 'short_name:en-US', 'name:en-US', 'short_name:en', 'name:en', 'short_name', 'name', 'brand', 'official_name:en-US', 'official_name:en', 'official_name', 'ref', 'type'
'Include address' => False
'Excluded place IDs' =>
'Try reversed query' => True
'Limit (for searches)' => 20
'Limit (for results)' => 10
'Country codes' =>
postgres=# \c nominatim;
You are now connected to database "nominatim" as user "postgres".
nominatim=# \di
List of relations
Schema | Name | Type | Owne
r | Table
--------+-------------------------------------------------------+-------+-------
----+---------------------------
public | idx_country_name_country_code | index | nomina
tim | country_name
# ..in general,
require 'rails'
require File.expand_path("../config/application.rb", __FILE__)
Rails.application.initialize!
# fork fork fork
ENV['UNICORN_WORKERS'].times do
fork do
# child
# -*- encoding: binary -*-
# This is the process manager of Unicorn. This manages worker
# processes which in turn handle the I/O and application process.
# Listener sockets are started in the master process and shared with
# forked worker children.
#
# Users do not need to know the internals of this class, but reading the
# {source}[https://bogomips.org/unicorn.git/tree/lib/unicorn/http_server.rb]
# is education for programmers wishing to learn how unicorn works.
module ConcurrentExecutor
class Error < StandardError
def initialize(exceptions)
@exceptions = exceptions
super
end
def message
@exceptions.map { | e | e.message }.join "\n"
end
# from_cte_sql = ::Namespace::From.where_clause
# ..
from_table = Arel::Table.new(:from_lane)
to_table = Arel::Table.new(:to_lane)
rates_table = Arel::Table.new(:rates)
rates_table
.join(from_table).on(rates_table[:from_id].eq(from_table[:id]))