Skip to content

Instantly share code, notes, and snippets.

View MBM1607's full-sized avatar
:electron:

Muhammad Khan MBM1607

:electron:
View GitHub Profile
@MBM1607
MBM1607 / github-integration-with-scheduler.md
Last active January 1, 2024 13:42
github-integration-with-scheduler
View github-integration-with-scheduler.md

GitHub Integration With Scheduler

This is a Plugin for one-way integration between GitHub & Redmine. This plugin has a scheduled task that can run at a customizable interval to fetch all projects & issues from a GitHub account and save them in Redmine.

Features

  • Syncs GitHub projects with Redmine projects
  • Syncs GitHub issues in each project with Redmine issues in the corresponding project
@MBM1607
MBM1607 / github-integration-with-cron.md
Last active January 1, 2024 08:21
GitHub Integration Instructions
View github-integration-with-cron.md

GitHub Integration

This is a Plugin for one-way integration between GitHub & Redmine. This plugin has a scheduled task that can run at a customizable interval to fetch all projects & issues from a GitHub account and save them in Redmine.

Features

  • Syncs GitHub projects with Redmine projects
  • Syncs GitHub issues in each project with Redmine issues in the corresponding project
@MBM1607
MBM1607 / code_to_dial_code.json
Last active February 24, 2023 11:05
Country and Dial or Phone codes in JSON format
View code_to_dial_code.json
{
"AF": "+93",
"AX": "+358",
"AL": "+355",
"DZ": "+213",
"AS": "+1684",
"AD": "+376",
"AO": "+244",
"AI": "+1264",
"AQ": "+672",
@MBM1607
MBM1607 / bubble_sort.rb
Created February 25, 2021 08:20
bubble sort with ruby
View bubble_sort.rb
def bubble_sort(array)
sorted = false
until sorted do
sorted = true
array.each_with_index do |_, i|
if i + 1 != array.length && array[i] > array[i + 1]
array[i], array[i + 1] = array[i + 1], array[i]
sorted = false
end
end
View gist:a5e10b9d03983d8474f6870045597d8b
def stock_picker(stocks)
profits = {}
stocks.each_with_index do |price_i, i|
stocks.each_with_index do |price_j, j|
profits[[i, j]] = price_j - price_i if j > i
end
end
index, _ = profits.max_by { |k, v| v }
@MBM1607
MBM1607 / substrings.rb
Created February 25, 2021 06:12
Ruby substrings exercise
View substrings.rb
# Return a hash listing each substring present in the dictionary found in the string
def substrings(string, dictionary)
count = Hash.new(0)
dictionary.each do |word|
count[word] = string.scan(/#{word}/).length if string.scan(/#{word}/).length != 0
end
puts count
end
@MBM1607
MBM1607 / ceaser_cipher.rb
Created February 25, 2021 06:00
Odin Project Ruby Ceaser Cipher
View ceaser_cipher.rb
def caesar_cipher(message, shift)
split_message = message.split("").map do |letter|
# If letter is not an alphabet do not change it
if letter.downcase.ord < 97 or letter.downcase.ord > 128
letter
else
code = letter.ord + shift
if (letter == letter.upcase && code > 90) || (letter == letter.downcase && code > 122)
code -= 26
end