Skip to content

Instantly share code, notes, and snippets.

View prio101's full-sized avatar
:shipit:
Making Stuff

Mahabub Islam Prio prio101

:shipit:
Making Stuff
View GitHub Profile
@prio101
prio101 / python
Last active September 14, 2024 13:54
only between bn and en.
from langdetect import detect_langs
from collections import defaultdict
def split_english_bangla(mixed_string):
# To hold the detected languages and their corresponding text parts
language_dict = defaultdict(str)
# Split the string into words (or tokens)
words = mixed_string.split()
@prio101
prio101 / group_by_n.js
Last active November 25, 2021 05:00
Group by the n spice
// Idea:
// get the main result set into:
// three seperate list in a main list: [[1,2,3], [1,2], [1,2....,n]]
// Maybe here in this case js will not clone the main list .
// it will manipulate the main list. Attention to it.
list = [1,2,3,4,5,6,7,8,9]
const group_by_n = (list) => {
// same as before:
@prio101
prio101 / group-for-rows.py
Last active November 24, 2021 06:11
Grouping for the Rows
def group(arr):
print("given set of the array: ", arr)
temp_list = []
group_maker_spice = 3 # base jumper
group_maker_spice_special_case_second_row = 2
result_list = []
for item in arr:
if item == 0 and len(arr) > group_maker_spice:
# insert the first 3 in a group
@prio101
prio101 / the_builder_of_things.rb
Created April 2, 2021 01:09 — forked from Insti/the_builder_of_things.rb
A Ruby solution to "The builder of things" codewars kata
# https://www.codewars.com/kata/the-builder-of-things/ruby
# https://www.codewars.com/kata/reviews/5571e09a385f59d95f000063/groups/59426d64e6049310a70006ce
# imported to handle any plural/singular conversions
require 'active_support/core_ext/string'
class Thing
def initialize(name)
@properties = {}
is_the.name.send(name)
@prio101
prio101 / init.vim
Created October 30, 2019 08:26
init file for the NEOVIM
let os = substitute(system('uname'), "\n", "", "")
call plug#begin('~/.config/nvim/autoload/')
Plug 'morhetz/gruvbox'
Plug 'chusiang/vim-sdcv' " How to install dict see https://askubuntu.com/questions/191125/is-there-an-offline-command-line-dictionary
Plug 'scrooloose/nerdtree'
Plug 'kassio/neoterm'
Plug 'janko-m/vim-test'
Plug 'benekastah/neomake'
defmodule Router.SitesRouter do
import Plug.Conn
use Plug.Router
plug :match
plug :dispatch
get "/" do
page = EEx.eval_file("views/sites/index.html.eex")
conn
defmodule Router.MainRouter do
use Plug.Router
plug :match
plug :dispatch
get "/" do
page = EEx.eval_file("views/index.html.eex")
conn
|> put_resp_content_type("text/html")
defmodule TodoList.Repo.Migrations.CreateTasks do
use Ecto.Migration
def change do
create table("tasks") do
add :task_name, :string
add :task_description, :string
add :task_status, :string
timestamps()
end
defmodule TodoList.Task do
use Ecto.Schema
import Poison
alias TodoList.Repo
schema "tasks" do
field :task_name
field :task_description
field :task_status
@prio101
prio101 / dev.exs
Last active August 28, 2018 18:58
use Mix.Config
config :todolist, TodoList.Repo, [
adapter: Ecto.Adapters.Postgres,
database: "todolist_#{Mix.env}",
username: "postgres",
password: "",
hostname: "localhost",
]