Skip to content

Instantly share code, notes, and snippets.

View mdibaiee's full-sized avatar
🦦
Otterly loving open-source

Mahdi Dibaiee mdibaiee

🦦
Otterly loving open-source
  • Dublin, Ireland
  • 01:13 (UTC +01:00)
View GitHub Profile
@mdibaiee
mdibaiee / go.mod
Created March 27, 2024 16:13
databricks close connection bug
module main
go 1.21.0
require github.com/databricks/databricks-sql-go v1.5.3
@mdibaiee
mdibaiee / Protonmail.md
Created October 13, 2022 16:46 — forked from tortoros/Protonmail.md
Configure the protonmail bridge linux client on CentOS server and Fedora

Protonmail on CentOS server

#protonmail #centos #fedora #linux

Before you start

Currently protonmail bridge for linux is distributed as part of an open beta program, but soon it will be made public (https://protonmail.com/bridge/install).

Consider that the bridge linux client requires a paid protonmail account to work.

Get the protonmail bridge linux installer

@mdibaiee
mdibaiee / plan.md
Last active July 7, 2023 13:42
Path to Programming
@mdibaiee
mdibaiee / README.md
Last active August 7, 2018 15:41
TOEFL Speaking Exercise

TOEFL Speaking Exercises

Wake up every morning and read 5 - 10 questions aloud, think about them for 15 seconds, and then start recording your voice, and answer the question for 45 seconds. Play your voice recording back and see where you could do better, then try the next question!

@mdibaiee
mdibaiee / github-notifications
Last active January 29, 2020 11:27
GitHub Notifications in i3bar
#!/bin/bash
# put this in your bin directory, e.g. /usr/bin or ~/.local/bin
sleep 20 # update interval
# you have to generate a new ACCESS_TOKEN for yourself here (https://github.com/settings/tokens, you only need "notifications" access) and replace the value
response=$(curl -s https://api.github.com/notifications?access_token=ACCESS_TOKEN)
if [[ $response =~ "{" ]]
@mdibaiee
mdibaiee / plot_annotations.md
Created October 1, 2016 09:36
Plotting Text

It's possible to plot text on chart using Plot.Annotation:

annotation chart

import Graphics.Rendering.Chart
import Graphics.Rendering.Chart.Backend.Cairo
import Data.Default.Class
import Control.Lens
@mdibaiee
mdibaiee / index.hs
Last active March 18, 2016 09:59
Huffman
module Huffman ( tree, charSequence, decode )
where
import Data.List
import Data.Function (on)
import Node
import qualified Data.Map as Map
import Data.Maybe
import Debug.Trace
import Data.Char (chr)
@mdibaiee
mdibaiee / tic-tac-toe.js
Created September 22, 2015 13:13
tic tac toe
function isSolved(board) {
board = board.join('-').replace(/,/g,'');
if(/222|2...2...2|2....2....2|2..2..2/.test(board)) return 2;
if(/111|1...1...1|1....1....1|1..1..1/.test(board)) return 1;
if(/0/.test(board)) return -1;
return 0;
}
@mdibaiee
mdibaiee / persian-slugify.js
Created August 11, 2015 17:44
persian-slugify.js
export function p2e(words) {
return words.split('').map(letter => {
switch (letter) {
case "ا": return "a";
case "آ": return "a";
case "ب": return "b";
case "ت": return "t";
case "ث": return "th";
case "ج": return "j";
case "ح": return "h";
export default class Trie {
constructor(value = '') {
this.value = value;
this.children = [];
}
add(value) {
let parent = this;
for (let i = 0, len = value.length; i < len; i++) {
let key = value.slice(0, i + 1);