Skip to content

Instantly share code, notes, and snippets.

View sobinsunny's full-sized avatar
🎯
Focusing

Sobin sobinsunny

🎯
Focusing
  • Mahindra Electric Mobility Limited
  • Banglore
View GitHub Profile
node --experimental-repl-await repl.js
var repl = require('repl');
var dotenv = require('dotenv');
dotenv.config();
const Knex = require('./knex-init')
const setupPaginator = require('knex-paginator');
setupPaginator(Knex);
const r = repl.start('Knex console > ');
const run = async () => {
r.context.knex = await Knex;
@sobinsunny
sobinsunny / knexAdapter.js
Last active August 30, 2019 07:20
code for Knex connection establish with postgres.
const pg = require('pg');
const knexConfig = {
 client: 'pg',
 connection: {
  host : process.env.SQL_HOST,
  database: process.env.SQL_DB,
  user: process.env.SQL_USERNAME,
  password: process.env.SQL_PASSWORD,
 }
};
@sobinsunny
sobinsunny / webpage.rb
Created October 26, 2016 03:36
modified
# Ruby 2.3.1
class WebPageRank
MAX_WEIGHT = 8
def initialize
# read input from file
@file = File.read('input.txt')
end
def process_input_file
@sobinsunny
sobinsunny / problem-1
Last active August 9, 2016 06:46
problem no-2
module AreAnagrams
def self.are_anagrams?(string_a, string_b)
raise NotImplementedError, 'Not implemented' if string_b.strip.empty? || string_b.strip.empty?
string_a.chars.sort == string_b.chars.sort
end
end
class SuerScore
def initialize
@row = []
end
def add(value)
@row.push(value.split(" "))
end
def tests(n=2)
output = []
@sobinsunny
sobinsunny / goals.md
Last active January 18, 2016 07:16 — forked from tachyons/goals.md
2016 Wish List

2016 Wish List

  • Technology
    • Programming Languages
      • Haskell
      • Rust
      • Elixir
      • Go
    • DBMS
      • Mongo Db
  • PrestoDb