This function takes an array of objects and executes a method in each object in parallel in multiple threads

Write one function that is useful for you and others

How many times you have been looking for a function that does one
thing and you end up using a gem just for one function?

Here we'll fix that, consider rubyfunctions.com is your repository
for useful functions, you can get back to it any time

Depend on Ruby standard library and core library only

We all have seen the problem with too many dependencies, here we'll try to be as minimal as we can, we'll build off of ruby core and standard library only, making our functions as independent as possible, this means you'll be able to use it any project regardless of its framework

Show it to others and get feedback

Now that you have a useful repository of functions you have wrote, show it to other developers, your function maybe useful for other people, Also you will get feedback from other developers to improve your knowledge, And you'll have the chance to also give feedback to others and learn something new from their functions

Emad Elsaid · @emad-elsaid · almost 3 years

4 ·
0 ·
3
Show code

Ali Hamdi Ali Fadel · @AliOsm · almost 3 years

Calculates the n-th Catalan number, (2N)! / (N! * (N + 1)!), in a mathematical operations efficient way.

0 ·
0 ·
2
Show code

Ali Hamdi Ali Fadel · @AliOsm · almost 3 years

Floyd-Warshall (all pairs shortest path) algorithm implementation.

0 ·
3 ·
1
Show code

Ali Hamdi Ali Fadel · @AliOsm · almost 3 years

Crawl a web page and extract URLs from its HTML using naive loop implementation. Its running time is comparable or less than using URI.extract().

2 ·
0 ·
1
Show code

Ali Hamdi Ali Fadel · @AliOsm · almost 3 years

Calculates N choose K, N! / (K! * (N - K)!), in a mathematical operations efficient way.

1 ·
0 ·
1
Show code

Ahmed Khaled · @nemoload · almost 3 years

Calculating the *n-th* number in **Fibonacci** sequence with dynamic programming.

4 ·
1 ·
1
Show code

ahmadabdelhalim · @ahmadabdelhalim · almost 3 years

a function that accepts a string as an argument, and returns a new string where streaks of consecutive characters are compressed. For example “aaabbc” is compressed to “3a2bc”.

2 ·
1 ·
0
Show code

Ahmed Magdy · @a7madM · almost 3 years

calculates factorial of a number recursively

1 ·
2 ·
0
Show code

Functional way for implementing reduce.

it invokes function for each element in the enumerable with the accumulator.

1 ·
0 ·
0
Show code

Abd Elrahman Telb · @abdoutelb · almost 3 years

Take a number and return the its factorial in Iterative way.

3 ·
0 ·
0
Show code

Ali Hamdi Ali Fadel · @AliOsm · almost 3 years

Calculates the n-th Fibonacci number iteratively.

0 ·
0 ·
0
Show code

Ali Hamdi Ali Fadel · @AliOsm · almost 3 years

Takes a string and return true if it is a palindrome, false otherwise.

0 ·
3 ·
0
Show code

Ali Hamdi Ali Fadel · @AliOsm · almost 3 years

Return true if two number are relatively prime (co-prime), false otherwise.

1 ·
0 ·
0
Show code

Ahmed Khaled · @nemoload · about 1 year

Creates a thread pool that takes a block and run it in parallel with different jobs and returns a list of the results

0 ·
0 ·
0
Show code

Your next adventures

Lets start our journey in ruby functions. The following steps should help your get started.

- Login with your Github account
- Publish your first function
- Like at least 5 functions
- Write at least 5 comments
- Save at least 5 functions
- Publish 10 functions