- Technology
- Programming Languages
- Haskell
- Rust
- Elixir
- Go
- DBMS
- Mongo Db
- Programming Languages
- PrestoDb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node --experimental-repl-await repl.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SuerScore | |
def initialize | |
@row = [] | |
end | |
def add(value) | |
@row.push(value.split(" ")) | |
end | |
def tests(n=2) | |
output = [] |