Skip to content

Instantly share code, notes, and snippets.

View ketanghumatkar's full-sized avatar

Ketan Ghumatkar ketanghumatkar

View GitHub Profile
@ketanghumatkar
ketanghumatkar / ir_notes.md
Created July 5, 2020 13:49
Information Retrieval
@ketanghumatkar
ketanghumatkar / ir_system_nlp.py
Created April 25, 2020 19:56
Mtech IR system
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 23 14:26:40 2020
@author: kets
"""
####################################################################################
# HTML PARSER
####################################################################################
@ketanghumatkar
ketanghumatkar / js_basic_example.js
Last active June 27, 2019 12:27
Javascript basics examples for Intern training
var example = {
a: 'a',
b: 1,
c: function () {
return 'I am here!';
},
'good-example': 'Nice work'
}
example.a // 'a'
@ketanghumatkar
ketanghumatkar / react_es6_syntax.md
Created June 23, 2019 14:52
ES6 syntax used in react.js

Use of ES6 in React

Declairation of class

class Developer {
  constructor(name) {
    this.name = name;
  }

  hello() {
@ketanghumatkar
ketanghumatkar / javascript_hoisting_examples.js
Created November 27, 2018 04:48
javascript_hoisting_examples
// Program 1
function foo(){
function bar() {
return 3;
}
return bar();
function bar() {
return 8;
}
@ketanghumatkar
ketanghumatkar / create_ssl_certificate.md
Created July 16, 2018 14:17
Generate Self Certified SSL Certificate

Generate Self Certified SSL Certificate using openssl

  1. openssl
  2. genrsa -des3 -out treeni.key 1024
  3. req -new -key treeni.key -sha256 -out treeni.csr
  4. x509 -req -days 365 -in treeni.csr -signkey treeni.key -sha256 -out treeni.crt
  5. x509 -in treeni.crt -out treeni.pem -outform PEM
@ketanghumatkar
ketanghumatkar / ldap_ruby_connector.rb
Created June 12, 2018 09:53
Sample LDAP connection script
## Sample ldap example with free testing ldap server
require 'rubygems'
require 'net/ldap'
# direct connect without admin user and password
ldap = Net::LDAP.new :host => 'ldap.forumsys.com',
:port => 389
# return true if connection successful
@ketanghumatkar
ketanghumatkar / send_mail_outside_rails.rb
Last active July 28, 2021 13:25
Send mail outside rails project with CSV attachment
#!/usr/bin/env ruby
##
# Run ruby script outside rails project by loading rails env
# Script will sent mail with csv attachment and run through cronjob
# Steps :-
# 1. Load rails environment
# 2. Set Mail SMTP configuration
# 3. Generate CSV
# 4. Configure mail
@ketanghumatkar
ketanghumatkar / authorization_approach.rb
Created January 6, 2018 09:34
New Governance Approach in rails
### NEW Governance approach
## Model Governance
### For delete action validation
class Sample
include Mongoid::Document
before_destroy :authorize