Skip to content

Instantly share code, notes, and snippets.

Avatar

Midhun Krishna midhunkrishna

View GitHub Profile
View dynamic_fields.md

graphql ruby dynamically refresh schema, well a portion of it. ;)

class Types::DrugType
  
  # hook method that is called to check whether fields changed or not. 
  def self.dynamic_field_hook
    # this is example code, basically if the dynamic fields 
    # defined for a `SomeType` changes, the checksum changes as well
    DynamicField.for(DrugType).checksum
View init.el
;; Override Emacs Internals
(defun smarter-move-beginning-of-line (arg)
"In Emacs there are two essential commands when you have to
go the beginning of a line - move-beginning-of-line(bound to C-a)
and back-to-indentation(bound to M-m). The first takes you to the first
column of a line and the latter takes you the first non-whitespace
character on a line.
View pre-commit.sh
#!/bin/bash -l
echo "precommit running"
if (($(git diff --name-only --cached | grep ".rb" | wc -l) > 0)); then
echo "RuboCop autofix running..."
cd ~/vineti-platform/platform && bundle exec rubocop --fail-level A -a
exit $?
fi
View prepare-commit-msg.sh
#!/bin/bash
if ! grep -q ci-run "$1" ; then
sed -i.bak -e "1s/^/[ci-skip] /" $1
fi
@midhunkrishna
midhunkrishna / .spacemacs.el
Last active Feb 16, 2020
Spacemacs Configuration
View .spacemacs.el
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
View rakesh_etta_company
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 Nov 6, 2018
simple ruby threadsafe logger
View logger.rb
# Usage:
# DebugTools::Logger.log(String)
require 'fileutils'
module DebugTools
class Logger
def self.log(message)
FileUtils.touch(path) unless File.exist?(path)
View explain.txt
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
View specs.md
  • 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
View debug.info
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' =>
You can’t perform that action at this time.